mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Customize: Fix persistence of toggles for displayed nav menu item properties.
* Eliminates need to click more than one checkbox to have preferences saved. * Adds debouncing to saving user-selected menu item properties. * Also removes discrepancies between available nav menu item properties on admin page vs Customizer. Fixes #35273. Props afercia, westonruter. git-svn-id: https://develop.svn.wordpress.org/trunk@36908 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -34,8 +34,9 @@ class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
|
||||
* @access public
|
||||
*/
|
||||
public function render_screen_options() {
|
||||
// Essentially adds the screen options.
|
||||
add_filter( 'manage_nav-menus_columns', array( $this, 'wp_nav_menu_manage_columns' ) );
|
||||
// Adds the screen options.
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
|
||||
|
||||
// Display screen options.
|
||||
$screen = WP_Screen::get( 'nav-menus.php' );
|
||||
@@ -48,20 +49,12 @@ class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
|
||||
* Link title attribute added as it's a relatively advanced concept for new users.
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @access public
|
||||
*
|
||||
* @return array The advanced menu properties.
|
||||
* @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns().
|
||||
*/
|
||||
public function wp_nav_menu_manage_columns() {
|
||||
return array(
|
||||
'_title' => __( 'Show advanced menu properties' ),
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'link-target' => __( 'Link Target' ),
|
||||
'attr-title' => __( 'Title Attribute' ),
|
||||
'css-classes' => __( 'CSS Classes' ),
|
||||
'xfn' => __( 'Link Relationship (XFN)' ),
|
||||
'description' => __( 'Description' ),
|
||||
);
|
||||
_deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' );
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
return wp_nav_menu_manage_columns();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user