<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[42034] trunk: Customize: Deprecate nav menu classes that are no longer used, instead of removing them immediately.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/42034">42034</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/42034","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>westonruter</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-10-28 05:47:06 +0000 (Sat, 28 Oct 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Customize: Deprecate nav menu classes that are no longer used, instead of removing them immediately.
* Deprecate PHP classes `WP_Customize_New_Menu_Section` and `WP_Customize_New_Menu_Control`.
* Deprecate JS class `wp.customize.Menus.NewMenuControl`.
* Also introduce `wp.customize.Menus.createNavMenu()` for logic to create nav menus separately from the logic for handling UI interactions.
Amends <a href="https://core.trac.wordpress.org/changeset/41768">[41768]</a>.
See <a href="https://core.trac.wordpress.org/ticket/40104">#40104</a>, <a href="https://core.trac.wordpress.org/ticket/42364">#42364</a>.
Fixes <a href="https://core.trac.wordpress.org/ticket/42357">#42357</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjscustomizenavmenusjs">trunk/src/wp-admin/js/customize-nav-menus.js</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizecontrolphp">trunk/src/wp-includes/class-wp-customize-control.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizesectionphp">trunk/src/wp-includes/class-wp-customize-section.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizenewmenucontrolphp">trunk/src/wp-includes/customize/class-wp-customize-new-menu-control.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizenewmenusectionphp">trunk/src/wp-includes/customize/class-wp-customize-new-menu-section.php</a></li>
<li><a href="#trunktestsqunitwpadminjscustomizenavmenusjs">trunk/tests/qunit/wp-admin/js/customize-nav-menus.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjscustomizenavmenusjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-nav-menus.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-nav-menus.js 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-admin/js/customize-nav-menus.js 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1162,6 +1162,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Create a nav menu setting and section.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} [name=''] Nav menu name.
+ * @returns {wp.customize.Menus.MenuSection} Added nav menu.
+ */
+ api.Menus.createNavMenu = function createNavMenu( name ) {
+ var customizeId, placeholderId, setting;
+ placeholderId = api.Menus.generatePlaceholderAutoIncrementId();
+
+ customizeId = 'nav_menu[' + String( placeholderId ) + ']';
+
+ // Register the menu control setting.
+ setting = api.create( customizeId, customizeId, {}, {
+ type: 'nav_menu',
+ transport: api.Menus.data.settingTransport,
+ previewer: api.previewer
+ } );
+ setting.set( $.extend(
+ {},
+ api.Menus.data.defaultSettingValues.nav_menu,
+ {
+ name: name || ''
+ }
+ ) );
+
+ /*
+ * Add the menu section (and its controls).
+ * Note that this will automatically create the required controls
+ * inside via the Section's ready method.
+ */
+ return api.section.add( new api.Menus.MenuSection( customizeId, {
+ panel: 'nav_menus',
+ title: displayNavMenuName( name ),
+ customizeAction: api.Menus.data.l10n.customizingMenus,
+ priority: 10,
+ menu_id: placeholderId
+ } ) );
+ };
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * wp.customize.Menus.NewMenuSection
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Customizer section for new menus.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1339,10 +1381,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> contentContainer = section.contentContainer,
</span><span class="cx" style="display: block; padding: 0 10px"> nameInput = contentContainer.find( '.menu-name-field' ).first(),
</span><span class="cx" style="display: block; padding: 0 10px"> name = nameInput.val(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menuSection,
- customizeId,
- editMenuSection,
- placeholderId = api.Menus.generatePlaceholderAutoIncrementId();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuSection;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> nameInput.addClass( 'invalid' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1350,36 +1389,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- customizeId = 'nav_menu[' + String( placeholderId ) + ']';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuSection = api.Menus.createNavMenu( name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Register the menu control setting.
- api.create( customizeId, customizeId, {}, {
- type: 'nav_menu',
- transport: api.Menus.data.settingTransport,
- previewer: api.previewer
- } );
- api( customizeId ).set( $.extend(
- {},
- api.Menus.data.defaultSettingValues.nav_menu,
- {
- name: name
- }
- ) );
-
- /*
- * Add the menu section (and its controls).
- * Note that this will automatically create the required controls
- * inside via the Section's ready method.
- */
- menuSection = new api.Menus.MenuSection( customizeId, {
- panel: 'nav_menus',
- title: displayNavMenuName( name ),
- customizeAction: api.Menus.data.l10n.customizingMenus,
- priority: 10,
- menu_id: placeholderId
- } );
- api.section.add( customizeId, menuSection );
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Clear name field.
</span><span class="cx" style="display: block; padding: 0 10px"> nameInput.val( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> nameInput.removeClass( 'invalid' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1390,7 +1401,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( checkbox.prop( 'checked' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> navMenuLocationSetting = api( 'nav_menu_locations[' + checkbox.data( 'location-id' ) + ']' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- navMenuLocationSetting.set( placeholderId );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ navMenuLocationSetting.set( menuSection.params.menu_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset state for next new menu
</span><span class="cx" style="display: block; padding: 0 10px"> checkbox.prop( 'checked', false );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1400,12 +1411,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp.a11y.speak( api.Menus.data.l10n.menuAdded );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Focus on the new menu section.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editMenuSection = api.section( customizeId );
- editMenuSection.focus( {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuSection.focus( {
</ins><span class="cx" style="display: block; padding: 0 10px"> completeCallback: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editMenuSection.highlightNewItemButton();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuSection.highlightNewItemButton();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } ); // @todo should we focus on the new menu's control and open the add-items panel? Thinking user flow...
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3008,6 +3018,87 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * wp.customize.Menus.NewMenuControl
+ *
+ * Customizer control for creating new menus and handling deletion of existing menus.
+ * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type.
+ *
+ * @constructor
+ * @augments wp.customize.Control
+ * @deprecated 4.9.0 This class is no longer used due to new menu creation UX.
+ */
+ api.Menus.NewMenuControl = api.Control.extend({
+
+ /**
+ * Initialize.
+ *
+ * @deprecated 4.9.0
+ */
+ initialize: function() {
+ if ( 'undefined' !== typeof console && console.warn ) {
+ console.warn( '[DEPRECATED] wp.customize.NewMenuControl will be removed. Please use wp.customize.Menus.createNavMenu() instead.' );
+ }
+ api.Control.prototype.initialize.apply( this, arguments );
+ },
+
+ /**
+ * Set up the control.
+ *
+ * @deprecated 4.9.0
+ */
+ ready: function() {
+ this._bindHandlers();
+ },
+
+ _bindHandlers: function() {
+ var self = this,
+ name = $( '#customize-control-new_menu_name input' ),
+ submit = $( '#create-new-menu-submit' );
+ name.on( 'keydown', function( event ) {
+ if ( 13 === event.which ) { // Enter.
+ self.submit();
+ }
+ } );
+ submit.on( 'click', function( event ) {
+ self.submit();
+ event.stopPropagation();
+ event.preventDefault();
+ } );
+ },
+
+ /**
+ * Create the new menu with the name supplied.
+ *
+ * @deprecated 4.9.0
+ */
+ submit: function() {
+
+ var control = this,
+ container = control.container.closest( '.accordion-section-new-menu' ),
+ nameInput = container.find( '.menu-name-field' ).first(),
+ name = nameInput.val(),
+ menuSection;
+
+ if ( ! name ) {
+ nameInput.addClass( 'invalid' );
+ nameInput.focus();
+ return;
+ }
+
+ menuSection = api.Menus.createNavMenu( name );
+
+ // Clear name field.
+ nameInput.val( '' );
+ nameInput.removeClass( 'invalid' );
+
+ wp.a11y.speak( api.Menus.data.l10n.menuAdded );
+
+ // Focus on the new menu section.
+ menuSection.focus();
+ }
+ });
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Extends wp.customize.controlConstructor with control constructor for
</span><span class="cx" style="display: block; padding: 0 10px"> * menu_location, menu_item, nav_menu, and new_menu.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3016,6 +3107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> nav_menu_item: api.Menus.MenuItemControl,
</span><span class="cx" style="display: block; padding: 0 10px"> nav_menu: api.Menus.MenuControl,
</span><span class="cx" style="display: block; padding: 0 10px"> nav_menu_name: api.Menus.MenuNameControl,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ new_menu: api.Menus.NewMenuControl, // @todo Remove in 5.0. See #42364.
</ins><span class="cx" style="display: block; padding: 0 10px"> nav_menu_locations: api.Menus.MenuLocationsControl,
</span><span class="cx" style="display: block; padding: 0 10px"> nav_menu_auto_add: api.Menus.MenuAutoAddControl
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizecontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-control.php 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-includes/class-wp-customize-control.php 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -769,6 +769,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * WP_Customize_Nav_Menu_Name_Control class.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent
+ * release, the require_once() here will be removed and _deprecated_file() will be called if file is
+ * required at all.
+ *
+ * @deprecated 4.9.0 This file is no longer used due to new menu creation UX.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,6 +317,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-control.php' ); // @todo Remove in 5.0. See #42364.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,6 +325,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-section.php' ); // @todo Remove in 5.0. See #42364.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-css-setting.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' );
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizesectionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-section.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-section.php 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-includes/class-wp-customize-section.php 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,3 +385,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** WP_Customize_Nav_Menu_Section class */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * WP_Customize_New_Menu_Section class
+ *
+ * As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent
+ * release, the require_once() here will be removed and _deprecated_file() will be called if file is
+ * required at all.
+ *
+ * @deprecated 4.9.0 This file is no longer used due to new menu creation UX.
+ */
+require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-section.php' );
</ins></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizenewmenucontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-new-menu-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-new-menu-control.php 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-includes/customize/class-wp-customize-new-menu-control.php 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,12 +5,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package WordPress
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage Customize
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.9.0 This file is no longer used as of the menu creation UX introduced in #40104.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Customize control class for new menus.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Control
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,6 +27,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $type = 'new_menu';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Constructor.
+ *
+ * @since 4.9.0
+ *
+ * @param WP_Customize_Manager $manager Manager.
+ * @param string $id ID.
+ * @param array $args Args.
+ */
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
+ _deprecated_file( basename( __FILE__ ), '4.9.0' ); // @todo Move this outside of class in 5.0, and remove its require_once() from class-wp-customize-control.php. See #42364.
+ parent::__construct( $manager, $id, $args );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Render the control's content.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizenewmenusectionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-new-menu-section.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-new-menu-section.php 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/src/wp-includes/customize/class-wp-customize-new-menu-section.php 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,14 +5,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package WordPress
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage Customize
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.9.0 This file is no longer used as of the menu creation UX introduced in #40104.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Customize Menu Section Class
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Implements the new-menu-ui toggle button instead of a regular section.
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Section
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,6 +27,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $type = 'new_menu';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Constructor.
+ *
+ * Any supplied $args override class property defaults.
+ *
+ * @since 4.9.0
+ *
+ * @param WP_Customize_Manager $manager Customizer bootstrap instance.
+ * @param string $id An specific ID of the section.
+ * @param array $args Section arguments.
+ */
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
+ _deprecated_file( basename( __FILE__ ), '4.9.0' ); // @todo Move this outside of class in 5.0, and remove its require_once() from class-wp-customize-section.php. See #42364.
+ parent::__construct( $manager, $id, $args );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Render the section, and the controls that have been added to it.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span></span></pre></div>
<a id="trunktestsqunitwpadminjscustomizenavmenusjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/qunit/wp-admin/js/customize-nav-menus.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/wp-admin/js/customize-nav-menus.js 2017-10-28 05:21:42 UTC (rev 42033)
+++ trunk/tests/qunit/wp-admin/js/customize-nav-menus.js 2017-10-28 05:47:06 UTC (rev 42034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,9 +113,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // @todo Add tests for api.Menus.MenuLocationsControl
</span><span class="cx" style="display: block; padding: 0 10px"> // @todo Add tests for api.Menus.MenuAutoAddControl
</span><span class="cx" style="display: block; padding: 0 10px"> // @todo Add tests for api.Menus.MenuControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // @todo Add tests for api.Menus.NewMenuControl
</del><span class="cx" style="display: block; padding: 0 10px"> // @todo Add tests for api.Menus.applySavedData
</span><span class="cx" style="display: block; padding: 0 10px"> // @todo Add tests for api.Menus.focusMenuItemControl
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // @todo Add tests for api.Menus.createNavMenu
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> test( 'api.Menus.getMenuControl() should return the expected control', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var control = api.Menus.getMenuControl( primaryMenuId );
</span></span></pre>
</div>
</div>
</body>
</html>