<!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>[33221] trunk/src/wp-includes/class-wp-customize-setting.php: Fix syntax and add missing `@access` tags to a variety of methods and properties in `WP_Customize_Nav_Menu_Item_Setting` added in 4.3.</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/33221">33221</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/33221","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>DrewAPicture</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-07-13 21:00:29 +0000 (Mon, 13 Jul 2015)</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'>Fix syntax and add missing `@access` tags to a variety of methods and properties in `WP_Customize_Nav_Menu_Item_Setting` added in 4.3.
See <a href="https://core.trac.wordpress.org/changeset/32806">[32806]</a>. See <a href="https://core.trac.wordpress.org/ticket/32891">#32891</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpcustomizesettingphp">trunk/src/wp-includes/class-wp-customize-setting.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpcustomizesettingphp"></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-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-setting.php 2015-07-13 20:48:47 UTC (rev 33220)
+++ trunk/src/wp-includes/class-wp-customize-setting.php 2015-07-13 21:00:29 UTC (rev 33221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -639,7 +639,6 @@
</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 class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see wp_get_nav_menu_items()
</del><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Setting
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -654,7 +653,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Setting type.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $type = self::TYPE;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -663,9 +662,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default setting value.
</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">+ * @access public
+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_setup_nav_menu_item()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $default = array(
</span><span class="cx" style="display: block; padding: 0 10px"> // The $menu_item_data for wp_update_nav_menu_item().
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -691,7 +691,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default transport.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $transport = 'postMessage';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -704,7 +704,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo Should this be $db_id, and also use this for WP_Customize_Nav_Menu_Setting::$term_id
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $post_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -718,11 +718,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * a real post.
</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">+ * @access public
+ * @var int
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var int
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $previous_post_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -731,7 +731,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * which ensures that we can apply the proper filters.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $original_nav_menu_term_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -740,7 +740,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether or not preview() was called.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $is_previewed = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,7 +749,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether or not update() was called.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $is_updated = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -761,11 +761,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * When status is error, the error is stored in $update_error.
</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">+ * @access public
+ * @var string updated|inserted|deleted|error
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var string updated|inserted|deleted|error
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $update_status;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,11 +773,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Any error object returned by wp_update_nav_menu_item() when setting is updated.
</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">+ * @access public
+ * @var WP_Error
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var WP_Error
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $update_error;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -787,11 +787,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Any supplied $args override class property defaults.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param WP_Customize_Manager $manager Manager instance.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Customize_Manager $manager Bootstrap Customizer instance.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $id An specific ID of the setting. Can be a
</span><span class="cx" style="display: block; padding: 0 10px"> * theme mod or option name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args Optional. Setting arguments.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception If $id is not valid for this setting type.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -815,10 +817,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the instance data for a given widget setting.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_setup_nav_menu_item()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array Instance data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function value() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_previewed && $this->_previewed_blog_id === get_current_blog_id() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -889,6 +892,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Handle previewing the setting.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Manager::post_value()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -916,6 +920,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the wp_get_nav_menu_items() result to supply the previewed menu items.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_nav_menu_items()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -987,6 +992,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Re-apply the tail logic also applied on $items by wp_get_nav_menu_items().
</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">+ * @access public
+ * @static
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_nav_menu_items()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1021,8 +1028,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the value emulated into a WP_Post and set up as a nav_menu_item.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return WP_Post With {@see wp_setup_nav_menu_item()} applied.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return WP_Post With wp_setup_nav_menu_item() applied.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function value_as_wp_post_nav_menu_item() {
</span><span class="cx" style="display: block; padding: 0 10px"> $item = (object) $this->value();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1055,9 +1063,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * we remove that in this override.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $menu_item_value The value to sanitize.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. Otherwise the sanitized value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
+ * Otherwise the sanitized value.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function sanitize( $menu_item_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Menu is marked for deletion.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1132,13 +1142,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * To delete a menu, the client can send false as the value.
</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">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_update_nav_menu_item()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|false $value The menu item array to update. If false, then the menu item will be deleted entirely.
- * See {@see WP_Customize_Nav_Menu_Item_Setting::$default} for what the value should
- * consist of.
- * @return void
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array|false $value The menu item array to update. If false, then the menu item will be deleted
+ * entirely. See WP_Customize_Nav_Menu_Item_Setting::$default for what the value
+ * should consist of.
+ * @return null|void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function update( $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_updated ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1263,11 +1274,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Export data for the JS client.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Item_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Additional information passed back to the 'saved' event on `wp.customize`.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array Save response data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function amend_customize_save_response( $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $data['nav_menu_item_updates'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1280,7 +1292,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'error' => $this->update_error ? $this->update_error->get_error_code() : null,
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => $this->update_status,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> return $data;
</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">@@ -1308,7 +1319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Setting type.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $type = self::TYPE;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1317,10 +1328,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default setting value.
</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">+ * @access public
+ * @var array
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_nav_menu_object()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var array
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $default = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1333,7 +1344,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default transport.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $transport = 'postMessage';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1344,7 +1355,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * A negative value represents a placeholder ID for a new menu not yet saved.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $term_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1358,11 +1369,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * a real term.
</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">+ * @access public
+ * @var int
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var int
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $previous_term_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1370,7 +1381,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether or not preview() was called.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $is_previewed = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1379,7 +1390,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether or not update() was called.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $is_updated = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1391,11 +1402,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * When status is error, the error is stored in $update_error.
</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">+ * @access public
+ * @var string updated|inserted|deleted|error
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var string updated|inserted|deleted|error
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $update_status;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1403,11 +1414,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Any error object returned by wp_update_nav_menu_object() when setting is updated.
</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">+ * @access public
+ * @var WP_Error
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @var WP_Error
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $update_error;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1417,11 +1428,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Any supplied $args override class property defaults.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param WP_Customize_Manager $manager Manager instance.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Customize_Manager $manager Bootstrap Customizer instance.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $id An specific ID of the setting. Can be a
</span><span class="cx" style="display: block; padding: 0 10px"> * theme mod or option name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args Optional. Setting arguments.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception If $id is not valid for this setting type.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1442,10 +1455,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the instance data for a given widget setting.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_nav_menu_object()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array Instance data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function value() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_previewed && $this->_previewed_blog_id === get_current_blog_id() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1487,6 +1501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Handle previewing the setting.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Manager::post_value()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1510,6 +1525,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Requesting a nav_menu object by anything but ID is not supported.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_nav_menu_object()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1558,9 +1574,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the nav_menu_options option to include this menu's auto_add preference.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $nav_menu_options Nav menu options including auto_add.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array (Kaybe) modified nav menu options.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_nav_menu_options( $nav_menu_options ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->_previewed_blog_id !== get_current_blog_id() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1584,9 +1601,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * we remove that in this override.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $value The value to sanitize.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. Otherwise the sanitized value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
+ * Otherwise the sanitized value.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function sanitize( $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Menu is marked for deletion.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1631,6 +1650,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * To delete a menu, the client can send false as the value.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_update_nav_menu_object()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1643,7 +1663,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $parent The id of the parent term. Default 0.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $auto_add Whether pages will auto_add to this menu. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return void
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return null|void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function update( $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_updated ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1730,9 +1750,10 @@
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Update a nav_menu_options array.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Updates a nav_menu_options array.
</ins><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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::update()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1740,7 +1761,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ).
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $menu_id The term ID for the given menu.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $auto_add Whether to auto-add or not.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array (Maybe) modified nav_menu_otions array.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = (array) $nav_menu_options;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1762,11 +1783,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Export data for the JS client.
</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">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Nav_Menu_Setting::update()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Additional information passed back to the 'saved' event on `wp.customize`.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array Export data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function amend_customize_save_response( $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $data['nav_menu_updates'] ) ) {
</span></span></pre>
</div>
</div>
</body>
</html>