Skip to content

Commit

Permalink
Menus: Fix typo in the class attribute for the hidden title field i…
Browse files Browse the repository at this point in the history
…n `Walker_Nav_Menu_Checklist`.

Each item that `Walker_Nav_Menu_Checklist` displays is accompanied by several hidden `<input/>` fields that specify default values for each item when added to a menu. These values are passed in JavaScript to the AJAX call triggered when an item is added to a menu.

The hidden field for the title attribute field incorrectly had an underscore instead of a hyphen. Because of this, it was impossible to supply a default value for the Title Attribute field of a nav menu item.

Props yanngarcia, davidbaumwald.
See #47838.

git-svn-id: https://develop.svn.wordpress.org/trunk@46380 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Oct 3, 2019
1 parent 5a2c04c commit 271fc0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-walker-nav-menu-checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr( $item->title ) . '" />';
$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_attr( $item->url ) . '" />';
$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr( $item->target ) . '" />';
$output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="' . esc_attr( $item->attr_title ) . '" />';
$output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . esc_attr( $item->attr_title ) . '" />';
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr( implode( ' ', $item->classes ) ) . '" />';
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr( $item->xfn ) . '" />';
}
Expand Down

0 comments on commit 271fc0d

Please sign in to comment.