WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() WordPress Method

The amend_customize_save_response() method is used to amend the customize_save_response data that is sent back to the client after a successful customization request. This is useful for adding data that is not included in the default response. This method is called after the customize_save_response filter is applied, so the data that is passed to this method is the modified data that will be sent back to the client. The first parameter of this method is the $customize_save_response data that is being sent back to the client. The second parameter is the $wp_customize_manager instance. This method should return the modified $customize_save_response data.

WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response( array $data ) #

Export data for the JS client.


Description

Top ↑

See also


Top ↑

Parameters

$data

(array)(Required)Additional information passed back to the 'saved' event on wp.customize.


Top ↑

Return

(array) Save response data.


Top ↑

Source

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

	public function amend_customize_save_response( $data ) {
		if ( ! isset( $data['nav_menu_item_updates'] ) ) {
			$data['nav_menu_item_updates'] = array();
		}

		$data['nav_menu_item_updates'][] = array(
			'post_id'          => $this->post_id,
			'previous_post_id' => $this->previous_post_id,
			'error'            => $this->update_error ? $this->update_error->get_error_code() : null,
			'status'           => $this->update_status,
		);
		return $data;
	}

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.