diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
index 096a31b..b7556f6 100644
|
|
|
80 | 80 | }); |
81 | 81 | api.Menus.availableMenuItems = new api.Menus.AvailableItemCollection( api.Menus.data.availableMenuItems ); |
82 | 82 | |
83 | | api.Menus.insertedAutoDrafts = []; |
84 | | |
85 | 83 | /** |
86 | 84 | * Insert a new `auto-draft` post. |
87 | 85 | * |
… |
… |
|
104 | 102 | |
105 | 103 | request.done( function( response ) { |
106 | 104 | if ( response.post_id ) { |
107 | | api.Menus.insertedAutoDrafts.push( response.post_id ); |
108 | | api( 'nav_menus_created_posts' ).set( _.clone( api.Menus.insertedAutoDrafts ) ); |
| 105 | api( 'nav_menus_created_posts' ).set( |
| 106 | api( 'nav_menus_created_posts' ).get().concat( [ response.post_id ] ) |
| 107 | ); |
109 | 108 | |
110 | 109 | if ( 'page' === params.post_type ) { |
111 | 110 | |
… |
… |
|
2797 | 2796 | if ( data.nav_menu_updates || data.nav_menu_item_updates ) { |
2798 | 2797 | api.Menus.applySavedData( data ); |
2799 | 2798 | } |
| 2799 | } ); |
2800 | 2800 | |
2801 | | // Reset list of inserted auto draft post IDs. |
2802 | | api.Menus.insertedAutoDrafts = []; |
| 2801 | /* |
| 2802 | * Reset the list of posts created in the customizer once published. |
| 2803 | * The setting is updated quietly (bypassing events being triggered) |
| 2804 | * so that the customized state doesn't become immediately dirty. |
| 2805 | */ |
| 2806 | api.state( 'changesetStatus' ).bind( function( status ) { |
| 2807 | if ( 'publish' === status ) { |
| 2808 | api( 'nav_menus_created_posts' )._value = []; |
| 2809 | } |
2803 | 2810 | } ); |
2804 | 2811 | |
2805 | 2812 | // Open and focus menu control. |