<p class="field-move hide-if-no-js description description-wide">
<label>
<span><?php _e( 'Move' ); ?></span>
- <a href="#" class="menus-move-up"><?php _e( 'Up one' ); ?></a>
- <a href="#" class="menus-move-down"><?php _e( 'Down one' ); ?></a>
- <a href="#" class="menus-move-left"></a>
- <a href="#" class="menus-move-right"></a>
- <a href="#" class="menus-move-top"><?php _e( 'To the top' ); ?></a>
+ <a href="#" class="menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></a>
+ <a href="#" class="menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></a>
+ <a href="#" class="menus-move menus-move-left" data-dir="left"></a>
+ <a href="#" class="menus-move menus-move-right" data-dir="right"></a>
+ <a href="#" class="menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></a>
</label>
</p>
if ( 'markup' == $response_format ) {
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args );
} elseif ( 'json' == $response_format ) {
- echo json_encode(
+ echo wp_json_encode(
array(
'ID' => $object_id,
'post_title' => get_the_title( $object_id ),
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args );
} elseif ( 'json' == $response_format ) {
$post_obj = get_term( $object_id, $object_type );
- echo json_encode(
+ echo wp_json_encode(
array(
'ID' => $object_id,
'post_title' => $post_obj->name,
$var_by_ref = get_the_ID();
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args );
} elseif ( 'json' == $response_format ) {
- echo json_encode(
+ echo wp_json_encode(
array(
'ID' => get_the_ID(),
'post_title' => get_the_title(),
if ( 'markup' == $response_format ) {
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args );
} elseif ( 'json' == $response_format ) {
- echo json_encode(
+ echo wp_json_encode(
array(
'ID' => $term->term_id,
'post_title' => $term->name,
function wp_nav_menu_setup() {
// Register meta boxes
wp_nav_menu_post_type_meta_boxes();
- add_meta_box( 'add-custom-links', __( 'Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
+ add_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
wp_nav_menu_taxonomy_meta_boxes();
// Register advanced menu items (columns)
* @since 3.6.0
*
* @uses global $one_theme_location_no_menus to determine if no menus exist
- * @uses disabled() to output the disabled attribute in $other_attributes param in submit_button()
*
* @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
* @return string Disabled attribute if at least one menu exists, false if not
* 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.
+ * The dynamic portion of the hook name, `$post_type_name`, refers
+ * to the slug of the current post type.
*
* @since 3.2.0
*
*
* @since 3.0.0
*
- * @param string $menu_id The ID of the menu to format.
+ * @param int $menu_id Optional. The ID of the menu to format. Default 0.
* @return string|WP_Error $output The menu formatted to edit or error object on failure.
*/
function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
*
* @since 3.6.0
*
- * @uses wp_get_nav_menu_items() to retrieve the nav menu's menu items
- * @uses wp_defer_term_counter() to enable then disable term counting
- *
* @param int|string $nav_menu_selected_id (id, slug, or name ) of the currently-selected menu
* @param string $nav_menu_selected_title Title of the currently-selected menu
* @return array $messages The menu updated message
*/
function wp_nav_menu_update_menu_items ( $nav_menu_selected_id, $nav_menu_selected_title ) {
$unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish' ) );
-
+ $messages = array();
$menu_items = array();
// Index menu items by db ID
foreach ( $unsorted_menu_items as $_item )
/** 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>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';
unset( $menu_items, $unsorted_menu_items );
return $messages;