WP_Customize_Widgets::get_instance_hash_key() WordPress Method

The WP_Customize_Widgets::get_instance_hash_key() method is used to retrieve a hash key for a given widget instance. This can be used to ensure that a widget instance is unique, and to cache widget instance data.

WP_Customize_Widgets::get_instance_hash_key( string $serialized_instance ) #

Retrieves MAC for a serialized widget instance string.


Description

Allows values posted back from JS to be rejected if any tampering of the data has occurred.


Top ↑

Parameters

$serialized_instance

(string)(Required)Widget instance.


Top ↑

Return

(string) MAC for serialized widget instance.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	protected function get_instance_hash_key( $serialized_instance ) {
		return wp_hash( $serialized_instance );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.9.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.

Show More