From 6234be8d2287ee3e31bf4ac35c3000b178279e6f Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 7 Oct 2007 07:31:14 +0000 Subject: [PATCH] Add documentation of _wp_filter_build_unique_id(). Fixed #5053 props darkdragon. git-svn-id: https://develop.svn.wordpress.org/trunk@6200 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/plugin.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 2c04c1c226..4edf4e5165 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -283,6 +283,33 @@ function register_deactivation_hook($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) { global $wp_filter;