Customize: Ensure that WP_Customize_Nav_Menu_Section
is able to represent a placeholder nav menu.
Placeholder nav menus (ones that have yet to be saved into the DB) have negative integer IDs. Fixes #37293. Props valendesigns, stubgo, westonruter. git-svn-id: https://develop.svn.wordpress.org/trunk@37981 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8a1fad3178
commit
bddb06dd13
@ -36,7 +36,7 @@ class WP_Customize_Nav_Menu_Section extends WP_Customize_Section {
|
||||
*/
|
||||
public function json() {
|
||||
$exported = parent::json();
|
||||
$exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(\d+)\]/', '$1', $this->id ) );
|
||||
$exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(-?\d+)\]/', '$1', $this->id ) );
|
||||
|
||||
return $exported;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user