Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhwebworks/6627208 to your computer and use it in GitHub Desktop.
Save bhwebworks/6627208 to your computer and use it in GitHub Desktop.
/**
* Filter Simple Page Ordering to exclude Pages but include custom post types that are hierarchical but don't have page attributes
*
* @link http://blackhillswebworks.com/?p=5017
*/
add_filter( 'simple_page_ordering_is_sortable', 'bhww_turn_off_simple_page_ordering_for_pages' );
function bhww_turn_off_simple_page_ordering_for_pages( $sortable ) {
$screen = get_current_screen();
$post_type = $screen->post_type;
$sortable = ( ! post_type_supports( $post_type, 'page-attributes' ) && is_post_type_hierarchical( $post_type ) );
return $sortable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment