Add a per-post-type nav menu items filter for plugin control. props aaroncampbell. see #16075

git-svn-id: https://develop.svn.wordpress.org/trunk@17951 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2011-05-18 16:44:21 +00:00
parent 8ae9b16300
commit cc877850ac
1 changed files with 2 additions and 1 deletions

View File

@ -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'] ) ) {