mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 23:27:39 +02:00
Add documentation of _wp_filter_build_unique_id(). Fixed #5053 props darkdragon.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e026d1dfa2
commit
f6234acb5d
@ -283,6 +283,33 @@ function register_deactivation_hook($file, $function) {
|
|||||||
add_action('deactivate_' . $file, $function);
|
add_action('deactivate_' . $file, $function);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @access private
|
||||||
|
*
|
||||||
|
* _wp_filter_build_unique_id() - Build Unique ID for storage and retrieval
|
||||||
|
*
|
||||||
|
* This function is used to fix the issue where serialized, when used with
|
||||||
|
* classes that updated their properties, wouldn't be able to remove actions.
|
||||||
|
*
|
||||||
|
* How it works is that it first checks if the $function parameter is a string
|
||||||
|
* and passes it through, untouched. Functions won't need to be changed, since
|
||||||
|
* there can only be one declared.
|
||||||
|
*
|
||||||
|
* The second type that will be passed through untouched, is for static methods
|
||||||
|
* in classes. They don't need to be changed since they are much like functions
|
||||||
|
* in that you can only call one of them.
|
||||||
|
*
|
||||||
|
* The main purpose of this function is for classes, which can have more than
|
||||||
|
* one declared and you want to add more than one hook for each one that is
|
||||||
|
* declared, or want to change properties internal of the class that you declared
|
||||||
|
* the hook.
|
||||||
|
*
|
||||||
|
* @global $wp_filter
|
||||||
|
* @param string $tag Used in counting how many hooks were applied
|
||||||
|
* @param string|array $function Used for creating unique id
|
||||||
|
* @param int $priority Used in counting how many hooks were applied
|
||||||
|
* @return string Unique ID for usage as array key
|
||||||
|
*/
|
||||||
function _wp_filter_build_unique_id($tag, $function, $priority = 10)
|
function _wp_filter_build_unique_id($tag, $function, $priority = 10)
|
||||||
{
|
{
|
||||||
global $wp_filter;
|
global $wp_filter;
|
||||||
|
Loading…
Reference in New Issue
Block a user