return;
foreach ( $post_types as $post_type ) {
+ /**
+ * Filter whether a menu items meta box will be added for the current post type.
+ *
+ * If a falsey value is returned instead of a post type object,
+ * the post type menu items meta box will not be added.
+ *
+ * @since 3.0.0
+ *
+ * @param object $post_type The post type object to be used as a meta box.
+ */
$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
if ( $post_type ) {
$id = $post_type->name;
return;
foreach ( $taxonomies as $tax ) {
+ /**
+ * Filter whether a menu items meta box will be added for the current taxonomy.
+ *
+ * If a falsey value is returned instead of a taxonomy object,
+ * the taxonomy menu items meta box will not be added.
+ *
+ * @since 3.0.0
+ *
+ * @param object $tax The taxonomy object to be used as a meta box.
+ */
$tax = apply_filters( 'nav_menu_meta_box_object', $tax );
if ( $tax ) {
$id = $tax->name;
}
}
- $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
+ /**
+ * Filter the posts displayed in the 'View All' tab of the current
+ * post type's menu items meta box.
+ *
+ * The dynamic portion of the hook name, $post_type_name,
+ * refers to the slug of the current post type.
+ *
+ * @since 3.2.0
+ *
+ * @see WP_Query::query()
+ *
+ * @param array $posts The posts for the current post type.
+ * @param array $args An array of WP_Query arguments.
+ * @param object $post_type The current post type object for this menu item meta box.
+ */
+ $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'] ) ) {
</span>
<span class="add-to-menu">
- <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-' . $post_type_name ); ?>" />
+ <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-post-type-menu-item" id="<?php echo esc_attr( 'submit-posttype-' . $post_type_name ); ?>" />
<span class="spinner"></span>
</span>
</p>
</span>
<span class="add-to-menu">
- <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-taxonomy-menu-item" id="<?php esc_attr_e( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
+ <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-taxonomy-menu-item" id="<?php echo esc_attr( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
<span class="spinner"></span>
</span>
</p>
if( empty($menu_items) )
return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
+ /**
+ * Filter the Walker class used to render a menu formatted for editing.
+ *
+ * @since 3.0.0
+ *
+ * @param string $walker_class_name The Walker class used to render a menu formatted for editing.
+ * @param int $menu_id The ID of the menu being rendered.
+ */
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
if ( class_exists( $walker_class_name ) )
wp_defer_term_counting( false );
+ /** This action is documented in wp-includes/nav-menu.php */
do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
$messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';