X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3947bc013df7edd54b46deed8230d2eeafc5ecb..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-admin/nav-menus.php?ds=sidebyside diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index ab15bede..19348c23 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -22,7 +22,7 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( '
' . __( 'You are not allowed to edit theme options on this site.' ) . '
', + '' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '
', 403 ); } @@ -53,26 +53,8 @@ $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit'; * If a JSON blob of navigation menu data is found, expand it and inject it * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. */ -if ( isset( $_POST['nav-menu-data'] ) ) { - $data = json_decode( stripslashes( $_POST['nav-menu-data'] ) ); - if ( ! is_null( $data ) && $data ) { - foreach ( $data as $post_input_data ) { - // For input names that are arrays (e.g. `menu-item-db-id[3]`), derive the array path keys via regex. - if ( preg_match( '#(.*)\[(\w+)\]#', $post_input_data->name, $matches ) ) { - if ( empty( $_POST[ $matches[1] ] ) ) { - $_POST[ $matches[1] ] = array(); - } - // Cast input elements with a numeric array index to integers. - if ( is_numeric( $matches[2] ) ) { - $matches[2] = (int) $matches[2]; - } - $_POST[ $matches[1] ][ $matches[2] ] = wp_slash( $post_input_data->value ); - } else { - $_POST[ $post_input_data->name ] = wp_slash( $post_input_data->value ); - } - } - } -} +_wp_expand_nav_menu_post_data(); + switch ( $action ) { case 'add-menu-item': check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' ); @@ -536,7 +518,8 @@ if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) if ( ! $locations_screen ) : // Main tab $overview = '' . __( 'This screen is used for managing your custom navigation menus.' ) . '
'; - $overview .= '' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Custom Menu” widget on the Widgets screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Fifteen', 'Twenty Fourteen' ) . '
'; + /* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */ + $overview .= '' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Custom Menu” widget on the Widgets screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Sixteen', 'Twenty Seventeen' ) . '
'; $overview .= '' . __( 'From this screen you can:' ) . '
'; $overview .= '' . __('For more information:') . '
' . - '' . __('Documentation on Menus') . '
' . - '' . __('Support Forums') . '
' + '' . __('Documentation on Menus') . '
' . + '' . __('Support Forums') . '
' ); // Get the admin header. @@ -603,7 +586,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); array( 'autofocus' => $focus ), 'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), ), admin_url( 'customize.php' ) ) ), - __( 'Manage in Customizer' ) + __( 'Manage with Live Preview' ) ); endif; ?> @@ -711,7 +694,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); } /** - * Filter the number of locations listed per menu in the drop-down select. + * Filters the number of locations listed per menu in the drop-down select. * * @since 3.6.0 * @@ -731,7 +714,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); - + @@ -777,7 +760,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); />