<!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>[33256] trunk/src/wp-includes: Customizer: Improve performance of menus by caching results of `wp_setup_nav_menu_item()` calls.</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/33256">33256</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/33256","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>2015-07-14 07:08:40 +0000 (Tue, 14 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'>Customizer: Improve performance of menus by caching results of `wp_setup_nav_menu_item()` calls.
Also fixes property list in phpdoc for `wp_setup_nav_menu_item()`.
Fixes <a href="https://core.trac.wordpress.org/ticket/32769">#32769</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpcustomizenavmenusphp">trunk/src/wp-includes/class-wp-customize-nav-menus.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizesettingphp">trunk/src/wp-includes/class-wp-customize-setting.php</a></li>
<li><a href="#trunksrcwpincludesnavmenuphp">trunk/src/wp-includes/nav-menu.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpcustomizenavmenusphp"></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-nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-nav-menus.php 2015-07-14 06:38:19 UTC (rev 33255)
+++ trunk/src/wp-includes/class-wp-customize-nav-menus.php 2015-07-14 07:08:40 UTC (rev 33256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,8 +496,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create a setting for each menu item (which doesn't actually manage data, currently).
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_item_setting_id = 'nav_menu_item[' . $item->ID . ']';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->manager->add_setting( new WP_Customize_Nav_Menu_Item_Setting( $this->manager, $menu_item_setting_id ) );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $value = (array) $item;
+ $value['nav_menu_term_id'] = $menu_id;
+ $this->manager->add_setting( new WP_Customize_Nav_Menu_Item_Setting( $this->manager, $menu_item_setting_id, array(
+ 'value' => $value,
+ ) ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Create a control for each menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->add_control( new WP_Customize_Nav_Menu_Item_Control( $this->manager, $menu_item_setting_id, array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'label' => $item->title,
</span></span></pre></div>
<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-14 06:38:19 UTC (rev 33255)
+++ trunk/src/wp-includes/class-wp-customize-setting.php 2015-07-14 07:08:40 UTC (rev 33256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,8 +701,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @todo Should this be $db_id, and also use this for WP_Customize_Nav_Menu_Setting::$term_id
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -710,6 +708,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $post_id;
</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">+ * Storage of pre-setup menu item to prevent wasted calls to wp_setup_nav_menu_item().
+ *
+ * @since 4.3.0
+ * @access protected
+ * @var array
+ */
+ protected $value;
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Previous (placeholder) post ID used before creating a new menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This value will be exported to JS via the customize_save_response filter
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -806,14 +813,37 @@
</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"> $this->post_id = intval( $matches['id'] );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'wp_update_nav_menu_item', array( $this, 'flush_cached_value' ), 10, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $menu = $this->value();
- $this->original_nav_menu_term_id = $menu['nav_menu_term_id'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent::__construct( $manager, $id, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent::__construct( $manager, $id, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Ensure that an initially-supplied value is valid.
+ if ( isset( $this->value ) ) {
+ $this->populate_value();
+ foreach ( array_diff( array_keys( $this->default ), array_keys( $this->value ) ) as $missing ) {
+ throw new Exception( "Supplied nav_menu_item value missing property: $missing" );
+ }
+ }
+
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Clear the cached value when this nav menu item is updated.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param int $menu_id The term ID for the menu.
+ * @param int $menu_item_id The post ID for the menu item.
+ */
+ public function flush_cached_value( $menu_id, $menu_item_id ) {
+ unset( $menu_id );
+ if ( $menu_item_id === $this->post_id ) {
+ $this->value = null;
+ }
+ }
+
+ /**
</ins><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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -821,7 +851,7 @@
</span><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 Instance data.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array|false Instance data array, or false if the item is marked for deletion.
</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">@@ -833,6 +863,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $post_value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if ( isset( $this->value ) ) {
+ $value = $this->value;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -840,52 +872,107 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->post_id > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $this->post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $post && self::POST_TYPE === $post->post_type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $item = wp_setup_nav_menu_item( $post );
- $value = wp_array_slice_assoc(
- (array) $item,
- array_keys( $this->default )
- );
- $value['position'] = $item->menu_order;
- $value['status'] = $item->post_status;
- $value['original_title'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $value = (array) wp_setup_nav_menu_item( $post );
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $menus = wp_get_post_terms( $post->ID, WP_Customize_Nav_Menu_Setting::TAXONOMY, array(
- 'fields' => 'ids',
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_array( $value ) ) {
+ $value = $this->default;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $menus ) ) {
- $value['nav_menu_term_id'] = array_shift( $menus );
- } else {
- $value['nav_menu_term_id'] = 0;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cache the value for future calls to avoid having to re-call wp_setup_nav_menu_item().
+ $this->value = $value;
+ $this->populate_value();
+ $value = $this->value;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'post_type' === $value['type'] ) {
- $original_title = get_the_title( $value['object_id'] );
- } elseif ( 'taxonomy' === $value['type'] ) {
- $original_title = get_term_field( 'name', $value['object_id'], $value['object'], 'raw' );
- if ( is_wp_error( $original_title ) ) {
- $original_title = '';
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $value;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $original_title ) ) {
- $value['original_title'] = html_entity_decode( $original_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Ensure that the value is fully populated with the necessary properties.
+ *
+ * Translates some properties added by wp_setup_nav_menu_item() and removes others.
+ *
+ * @since 4.3.0
+ * @access protected
+ *
+ * @see WP_Customize_Nav_Menu_Item_Setting::value()
+ */
+ protected function populate_value() {
+ if ( ! is_array( $this->value ) ) {
+ return;
+ }
+
+ if ( isset( $this->value['menu_order'] ) ) {
+ $this->value['position'] = $this->value['menu_order'];
+ unset( $this->value['menu_order'] );
+ }
+ if ( isset( $this->value['post_status'] ) ) {
+ $this->value['status'] = $this->value['post_status'];
+ unset( $this->value['post_status'] );
+ }
+
+ if ( ! isset( $this->value['original_title'] ) ) {
+ $original_title = '';
+ if ( 'post_type' === $this->value['type'] ) {
+ $original_title = get_the_title( $this->value['object_id'] );
+ } elseif ( 'taxonomy' === $this->value['type'] ) {
+ $original_title = get_term_field( 'name', $this->value['object_id'], $this->value['object'], 'raw' );
+ if ( is_wp_error( $original_title ) ) {
+ $original_title = '';
</ins><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">+ $this->value['original_title'] = html_entity_decode( $original_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $value ) ) {
- $value = $this->default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $this->value['nav_menu_term_id'] ) && $this->post_id > 0 ) {
+ $menus = wp_get_post_terms( $this->post_id, WP_Customize_Nav_Menu_Setting::TAXONOMY, array(
+ 'fields' => 'ids',
+ ) );
+ if ( ! empty( $menus ) ) {
+ $this->value['nav_menu_term_id'] = array_shift( $menus );
+ } else {
+ $this->value['nav_menu_term_id'] = 0;
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $value ) ) {
- foreach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) {
- $value[ $key ] = intval( $value[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) {
+ if ( ! is_int( $this->value[ $key ] ) ) {
+ $this->value[ $key ] = intval( $this->value[ $key ] );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove remaining properties available on a setup nav_menu_item post object which aren't relevant to the setting value.
+ $irrelevant_properties = array(
+ 'ID',
+ 'comment_count',
+ 'comment_status',
+ 'db_id',
+ 'filter',
+ 'guid',
+ 'ping_status',
+ 'pinged',
+ 'post_author',
+ 'post_content',
+ 'post_content_filtered',
+ 'post_date',
+ 'post_date_gmt',
+ 'post_excerpt',
+ 'post_mime_type',
+ 'post_modified',
+ 'post_modified_gmt',
+ 'post_name',
+ 'post_parent',
+ 'post_password',
+ 'post_title',
+ 'post_type',
+ 'to_ping',
+ 'type_label',
+ );
+ foreach ( $irrelevant_properties as $property ) {
+ unset( $this->value[ $property ] );
+ }
</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">@@ -1043,16 +1130,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $item->menu_order = $item->position;
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $item->position );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $item->post_author = get_current_user_id();
-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( $item->title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $item->post_title = $item->title;
</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"> $item->ID = $this->post_id;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $item->db_id = $this->post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = new WP_Post( (object) $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = wp_setup_nav_menu_item( $post );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $post->post_author ) ) {
+ $post->post_author = get_current_user_id();
+ }
+
+ if ( ! isset( $post->type_label ) ) {
+ $post->type_label = null;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return $post;
</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">@@ -1160,6 +1252,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $is_placeholder = ( $this->post_id < 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $is_delete = ( false === $value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the cached value.
+ $this->value = $value;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_delete ) {
</span></span></pre></div>
<a id="trunksrcwpincludesnavmenuphp"></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/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/nav-menu.php 2015-07-14 06:38:19 UTC (rev 33255)
+++ trunk/src/wp-includes/nav-menu.php 2015-07-14 07:08:40 UTC (rev 33256)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -658,20 +658,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Decorates a menu item object with the shared navigation menu item properties.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Properties:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * - db_id: The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist).
- * - object_id: The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
- * - type: The family of objects originally represented, such as "post_type" or "taxonomy."
- * - object: The type of object originally represented, such as "category," "post", or "attachment."
- * - type_label: The singular label used to describe this type of menu item.
- * - post_parent: The DB ID of the original object's parent object, if any (0 otherwise).
- * - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
- * - url: The URL to which this menu item points.
- * - title: The title of this menu item.
- * - target: The target attribute of the link element for this menu item.
- * - attr_title: The title attribute of the link element for this menu item.
- * - classes: The array of class attribute values for the link element of this menu item.
- * - xfn: The XFN relationship expressed in the link of this menu item.
- * - description: The description of this menu item.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * - ID: The term_id if the menu item represents a taxonomy term.
+ * - attr_title: The title attribute of the link element for this menu item.
+ * - classes: The array of class attribute values for the link element of this menu item.
+ * - db_id: The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist).
+ * - description: The description of this menu item.
+ * - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
+ * - object: The type of object originally represented, such as "category," "post", or "attachment."
+ * - object_id: The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
+ * - post_parent: The DB ID of the original object's parent object, if any (0 otherwise).
+ * - post_title: A "no title" label if menu item represents a post that lacks a title.
+ * - target: The target attribute of the link element for this menu item.
+ * - title: The title of this menu item.
+ * - type: The family of objects originally represented, such as "post_type" or "taxonomy."
+ * - type_label: The singular label used to describe this type of menu item.
+ * - url: The URL to which this menu item points.
+ * - xfn: The XFN relationship expressed in the link of this menu item.
+ * - _invalid: Whether the menu item represents an object that no longer exists.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre>
</div>
</div>
</body>
</html>