mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Add a per-post-type nav menu items filter for plugin control. props aaroncampbell. see #16075
git-svn-id: http://svn.automattic.com/wordpress/trunk@17951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d2e54b7932
commit
bb8978972e
@ -628,7 +628,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
||||
|
||||
if ( !$posts )
|
||||
$error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>';
|
||||
|
||||
|
||||
$db_fields = false;
|
||||
if ( is_post_type_hierarchical( $post_type_name ) ) {
|
||||
$db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
|
||||
@ -745,6 +745,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
||||
}
|
||||
}
|
||||
|
||||
$posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
|
||||
$checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
|
||||
|
||||
if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user