Introduce taxonomies_allowed_in_menus and post_types_allowed_in_menus. Show only pages and categories by default. see #11817

git-svn-id: https://develop.svn.wordpress.org/trunk@13716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-03-16 17:22:24 +00:00
parent 9fe9b2390f
commit d1603a4246
1 changed files with 10 additions and 3 deletions

View File

@ -16,8 +16,11 @@ function wp_nav_menu_post_type_metaboxes() {
if ( !$post_types )
return false;
foreach ( $post_types as $post_type ) {
$allowed_types = apply_filters('post_types_allowed_in_menus', array('page'));
foreach ( $post_types as $post_type ) {
if ( !in_array($post_type->name, $allowed_types) )
continue;
$id = sanitize_title_with_dashes( $post_type->label );
// delete_transient( "nav_menu_items_{$post_type->name}" );
@ -37,9 +40,13 @@ function wp_nav_menu_taxonomy_metaboxes() {
if ( !$taxonomies )
return false;
$allowed_types = apply_filters('taxonomies_allowed_in_menus', array('category'));
foreach ( $taxonomies as $tax ) {
if ( !in_array($tax->name, $allowed_types) )
continue;
$id = sanitize_title_with_dashes( $tax->label );
// delete_transient( "nav_menu_items_{$tax->name}" );
// delete_transient( "nav_menu_sub_items_{$tax->name}" );