true ), 'object' );
if ( !$post_types )
return false;
$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 = $post_type->name;
add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $post_type->singular_label ), 'wp_nav_menu_item_post_type_metabox', 'menus', 'side', 'default', $post_type );
}
}
/**
* Creates metaboxes for any taxonomy menu item.
*
* @since 3.0.0
*/
function wp_nav_menu_taxonomy_metaboxes() {
$taxonomies = get_taxonomies( array( 'show_ui' => true ), 'object' );
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 = $tax->name;
add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax );
}
}
/**
* Displays a metabox for managing the active menu being edited.
*
* @since 3.0.0
*/
function wp_nav_menu_manage_menu_metabox( $object, $menu ) { ?>
'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 );
// @todo transient caching of these results with proper invalidation on updating links
$query = new WP_Query( $args );
?>
posts, 'custom' ); ?>
$post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 );
if ( 'attachment' == $post_type['args']->name )
$args['post_status'] = 'any';
// @todo transient caching of these results with proper invalidation on updating of a post of this type
$query = new WP_Query( $args );
if ( !$query->posts )
$error = '