Make WordPress Core

Changeset 37981


Ignore:
Timestamp:
07/06/2016 05:32:49 AM (10 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-section.php

    r35385 r37981  
    3737        public function json() {
    3838                $exported = parent::json();
    39                 $exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(\d+)\]/', '$1', $this->id ) );
     39                $exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(-?\d+)\]/', '$1', $this->id ) );
    4040
    4141                return $exported;
Note: See TracChangeset for help on using the changeset viewer.