WP_Customize_Nav_Menu_Item_Setting::flush_cached_value() WordPress Method

The WP_Customize_Nav_Menu_Item_Setting::flush_cached_value() method is used to clear the cached value for a given setting. This is useful when the setting's value is changed programmatically and you need to ensure that the change is reflected in the Customizer.

WP_Customize_Nav_Menu_Item_Setting::flush_cached_value( int $menu_id, int $menu_item_id ) #

Clear the cached value when this nav menu item is updated.


Parameters

$menu_id

(int)(Required)The term ID for the menu.

$menu_item_id

(int)(Required)The post ID for the menu item.


Top ↑

Source

File: wp-includes/customize/class-wp-customize-nav-menu-item-setting.php

	public function flush_cached_value( $menu_id, $menu_item_id ) {
		unset( $menu_id );
		if ( $menu_item_id === $this->post_id ) {
			$this->value = null;
		}
	}

Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.