Exclude pages from ordering | WordPress.org

[ad_1]

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 );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer