Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    You can try to use simple_page_ordering_is_sortable filter:

    add_filter('simple_page_ordering_is_sortable', 'wpsam_set_sortable_types', 10,2);
    function wpsam_set_sortable_types($sortable, $post_type){
    
      if ( 0 === strcmp($post_type, 'page') ){
        return false;
      }
    
      return true;
    
    }

    Plugin Contributor Jake Goldman

    (@jakemgold)

    That’s basically the right path, Pawel, but you don’t want to return true in all other conditions! Here’s the right way:

    add_filter('simple_page_ordering_is_sortable', 'wpsam_set_sortable_types', 10,2);
    
    function wpsam_set_sortable_types($sortable, $post_type){
      if ( $post_type == 'page' ) {
        return false;
      }
    
      return $sortable;
    }

    This should go into the FAQ or installation instructions.

    Very helpful! Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to deactivate just for 'page' post_type’ is closed to new replies.