• Resolved themightyant

    (@themightyant)


    I realise this plugin sorts boths pages and custom post types but I only want to allow reordering CPTs. Is there a way to exclude pages?

    I saw the code to exclude CPTs is as follows and I tried replacing ‘excluded_post_type’ with common numbers like 1, 2 & 3 but it didn’t seem to work. What is the Pages post_type_id and does it work with this code snippet? Thanks

    add_filter( 'simple_page_ordering_is_sortable', function( $sortable, $post_type ) {
        if ( 'excluded_post_type' === $post_type ) {
            return false;
        }
        return $sortable;
    }, 10, 2 );
Viewing 1 replies (of 1 total)
  • Thread Starter themightyant

    (@themightyant)

    Sorry was having a complete brain fart. Was looking for an ID (number) not post type (name) of course ‘page’ works fine.

Viewing 1 replies (of 1 total)
  • The topic ‘Exclude pages from ordering’ is closed to new replies.