WP_Customize_Nav_Menus::hash_nav_menu_args() WordPress Method

The WP_Customize_Nav_Menus::hash_nav_menu_args() method is used to hash the arguments for a given nav menu. This is done to ensure that the nav menu can be correctly fetched when it is requested by the client.

WP_Customize_Nav_Menus::hash_nav_menu_args( array $args ) #

Hashes (hmac) the nav menu arguments to ensure they are not tampered with when submitted in the Ajax request.


Description

Note that the array is expected to be pre-sorted.


Top ↑

Parameters

$args

(array)(Required)The arguments to hash.


Top ↑

Return

(string) Hashed nav menu arguments.


Top ↑

Source

File: wp-includes/class-wp-customize-nav-menus.php

	public function hash_nav_menu_args( $args ) {
		return wp_hash( serialize( $args ) );
	}


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.