Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.