Ticket #5225: plugin.6278.phpdoc.patch
File plugin.6278.phpdoc.patch, 7.1 KB (added by , 17 years ago) |
---|
-
plugin.php
7 7 * The API callback examples reference functions, but can be methods of classes. 8 8 * To hook methods, you'll need to pass an array one of two ways. 9 9 * 10 * For static methods (you won't have access to the <tt>$this</tt> variable in the11 * method):12 * <code>array('class_name', 'method_name');</code>13 *14 * The second method will need the reference to the object to have access to the15 * method.16 * <code>array(&$this, 'method_name');</code>17 * <code>18 * $obj = new myObject();19 * array(&$obj, 'method_name');20 * </code>21 10 * Any of the syntaxes explained in the PHP documentation for the 22 * {@link http://us2.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback' type} are valid. 11 * {@link http://us2.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} 12 * type are valid. 23 13 * 24 14 * Also see the {@link http://codex.wordpress.org/Plugin_API Plugin API} for more information 25 15 * and examples on how to use a lot of these functions. … … 30 20 */ 31 21 32 22 /** 33 * Hooks a function or method to a specific filter action.23 * add_filter() - Hooks a function or method to a specific filter action. 34 24 * 35 25 * Filters are the hooks that WordPress launches to modify text of various types 36 26 * before adding it to the database or sending it to the browser screen. Plugins … … 58 48 * 59 49 * @package WordPress 60 50 * @subpackage Plugin 61 * @since 1.551 * @since 0.71 62 52 * @global array $wp_filter Stores all of the filters added in the form of 63 53 * wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]'] 64 54 * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process. … … 79 69 } 80 70 81 71 /** 82 * Call the functions added to a filter hook.72 * apply_filters() - Call the functions added to a filter hook. 83 73 * 84 74 * The callback functions attached to filter hook <tt>$tag</tt> are invoked by 85 75 * calling this function. This function can be used to create a new filter hook … … 91 81 * function example_hook($string, $arg1, $arg2) 92 82 * { 93 83 * //Do stuff 84 * return $string; 94 85 * } 95 86 * $value = apply_filters('example_filter', 'filter me', 'arg1', 'arg2'); 96 87 * </code> 97 88 * 98 89 * @package WordPress 99 90 * @subpackage Plugin 100 * @since 1.591 * @since 0.71 101 92 * @global array $wp_filter Stores all of the filters 102 93 * @global array $merge_filters Merges the filter hooks using this function. 103 94 * … … 132 123 } 133 124 134 125 /** 135 * Merge the filter functions of a specific filter hook with generic filter functions.126 * merge_filters() - Merge the filter functions of a specific filter hook with generic filter functions. 136 127 * 137 128 * It is possible to defined generic filter functions using the filter hook 138 129 * <em>all</e>. These functions are called for every filter tag. This function … … 164 155 } 165 156 166 157 /** 167 * Removes a function from a specified filter hook.158 * remove_filter() - Removes a function from a specified filter hook. 168 159 * 169 160 * This function removes a function attached to a specified filter hook. This 170 161 * method can be used to remove default functions attached to a specific filter … … 176 167 * 177 168 * @package WordPress 178 169 * @subpackage Plugin 179 * @since 1. 5170 * @since 1.2 180 171 * 181 172 * @param string $tag The filter hook to which the function to be removed is hooked. 182 173 * @param callback $function_to_remove The name of the function which should be removed. … … 196 187 } 197 188 198 189 /** 199 * Hooks a function on to a specific action.190 * add_action() - Hooks a function on to a specific action. 200 191 * 201 192 * Actions are the hooks that the WordPress core launches at specific points 202 193 * during execution, or when specific events occur. Plugins can specify that … … 207 198 * 208 199 * @package WordPress 209 200 * @subpackage Plugin 210 * @since 1. 5201 * @since 1.2 211 202 * 212 203 * @param string $tag The name of the action to which the <tt>$function_to-add</tt> is hooked. 213 204 * @param callback $function_to_add The name of the function you wish to be called. … … 219 210 } 220 211 221 212 /** 222 * Execute functions hooked on a specific action hook.213 * do_action() - Execute functions hooked on a specific action hook. 223 214 * 224 215 * This function invokes all functions attached to action hook <tt>$tag</tt>. 225 216 * It is possible to create new action hooks by simply calling this function, … … 232 223 * 233 224 * @package WordPress 234 225 * @subpackage Plugin 235 * @since 1. 5226 * @since 1.2 236 227 * @global array $wp_filter Stores all of the filters 237 228 * @global array $wp_actions Increments the amount of times action was triggered. 238 229 * … … 271 262 } 272 263 273 264 /** 274 * Return the number times an action is fired.265 * did_action() - Return the number times an action is fired. 275 266 * 276 267 * @package WordPress 277 268 * @subpackage Plugin … … 291 282 } 292 283 293 284 /** 294 * Execute functions hooked on a specific action hook, specifying arguments in an array.285 * do_action_ref_array() - Execute functions hooked on a specific action hook, specifying arguments in an array. 295 286 * 296 287 * @see do_action() This function is identical, but the arguments passed to 297 288 * the functions hooked to <tt>$tag</tt> are supplied using an array. … … 331 322 } 332 323 333 324 /** 334 * Removes a function from a specified action hook.325 * remove_action() - Removes a function from a specified action hook. 335 326 * 336 327 * This function removes a function attached to a specified action hook. This 337 328 * method can be used to remove default functions attached to a specific filter … … 341 332 * 342 333 * @package WordPress 343 334 * @subpackage Plugin 344 * @since 1. 5335 * @since 1.2 345 336 * 346 337 * @param string $tag The action hook to which the function to be removed is hooked. 347 338 * @param callback $function_to_remove The name of the function which should be removed. … … 358 349 // 359 350 360 351 /** 361 * Gets the basename of a plugin.352 * plugin_basename() - Gets the basename of a plugin. 362 353 * 363 354 * This method extract the name of a plugin from its filename. 364 355 * … … 379 370 } 380 371 381 372 /** 382 * Hook a function on a plugin activation action hook.373 * register_activation_hook() - Hook a function on a plugin activation action hook. 383 374 * 384 375 * When a plugin is activated, the action 'activate_PLUGINNAME' hook is 385 376 * activated. In the name of this hook, PLUGINNAME is replaced with the name of … … 392 383 * 393 384 * @package WordPress 394 385 * @subpackage Plugin 395 * @since 1.5386 * @since 2.0 396 387 * 397 388 * @access private 398 389 * … … 405 396 } 406 397 407 398 /** 408 * Hook a function on a plugin deactivation action hook.399 * register_deactivation_hook() - Hook a function on a plugin deactivation action hook. 409 400 * 410 401 * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is 411 402 * deactivated. In the name of this hook, PLUGINNAME is replaced with the name of … … 431 422 } 432 423 433 424 /** 434 * Build Unique ID for storage and retrieval425 * _wp_filter_build_unique_id() - Build Unique ID for storage and retrieval 435 426 * 436 427 * The old way to serialize the callback caused issues and this function is the 437 428 * solution. It works by checking for objects and creating an a new property in