Ticket #5225: plugin.phpdoc.4.diff
File plugin.phpdoc.4.diff, 7.0 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 … … 97 87 * 98 88 * @package WordPress 99 89 * @subpackage Plugin 100 * @since 1.590 * @since 0.71 101 91 * @global array $wp_filter Stores all of the filters 102 92 * @global array $merge_filters Merges the filter hooks using this function. 103 93 * … … 132 122 } 133 123 134 124 /** 135 * Merge the filter functions of a specific filter hook with generic filter functions.125 * merge_filters() - Merge the filter functions of a specific filter hook with generic filter functions. 136 126 * 137 127 * It is possible to defined generic filter functions using the filter hook 138 128 * <em>all</e>. These functions are called for every filter tag. This function … … 164 154 } 165 155 166 156 /** 167 * Removes a function from a specified filter hook.157 * remove_filter() - Removes a function from a specified filter hook. 168 158 * 169 159 * This function removes a function attached to a specified filter hook. This 170 160 * method can be used to remove default functions attached to a specific filter … … 176 166 * 177 167 * @package WordPress 178 168 * @subpackage Plugin 179 * @since 1. 5169 * @since 1.2 180 170 * 181 171 * @param string $tag The filter hook to which the function to be removed is hooked. 182 172 * @param callback $function_to_remove The name of the function which should be removed. … … 196 186 } 197 187 198 188 /** 199 * Hooks a function on to a specific action.189 * add_action() - Hooks a function on to a specific action. 200 190 * 201 191 * Actions are the hooks that the WordPress core launches at specific points 202 192 * during execution, or when specific events occur. Plugins can specify that … … 207 197 * 208 198 * @package WordPress 209 199 * @subpackage Plugin 210 * @since 1. 5200 * @since 1.2 211 201 * 212 202 * @param string $tag The name of the action to which the <tt>$function_to-add</tt> is hooked. 213 203 * @param callback $function_to_add The name of the function you wish to be called. … … 219 209 } 220 210 221 211 /** 222 * Execute functions hooked on a specific action hook.212 * do_action() - Execute functions hooked on a specific action hook. 223 213 * 224 214 * This function invokes all functions attached to action hook <tt>$tag</tt>. 225 215 * It is possible to create new action hooks by simply calling this function, … … 232 222 * 233 223 * @package WordPress 234 224 * @subpackage Plugin 235 * @since 1. 5225 * @since 1.2 236 226 * @global array $wp_filter Stores all of the filters 237 227 * @global array $wp_actions Increments the amount of times action was triggered. 238 228 * … … 271 261 } 272 262 273 263 /** 274 * Return the number times an action is fired.264 * did_action() - Return the number times an action is fired. 275 265 * 276 266 * @package WordPress 277 267 * @subpackage Plugin … … 291 281 } 292 282 293 283 /** 294 * Execute functions hooked on a specific action hook, specifying arguments in an array.284 * do_action_ref_array() - Execute functions hooked on a specific action hook, specifying arguments in an array. 295 285 * 296 286 * @see do_action() This function is identical, but the arguments passed to 297 287 * the functions hooked to <tt>$tag</tt> are supplied using an array. … … 331 321 } 332 322 333 323 /** 334 * Removes a function from a specified action hook.324 * remove_action() - Removes a function from a specified action hook. 335 325 * 336 326 * This function removes a function attached to a specified action hook. This 337 327 * method can be used to remove default functions attached to a specific filter … … 341 331 * 342 332 * @package WordPress 343 333 * @subpackage Plugin 344 * @since 1. 5334 * @since 1.2 345 335 * 346 336 * @param string $tag The action hook to which the function to be removed is hooked. 347 337 * @param callback $function_to_remove The name of the function which should be removed. … … 379 369 } 380 370 381 371 /** 382 * Hook a function on a plugin activation action hook.372 * register_activation_hook() - Hook a function on a plugin activation action hook. 383 373 * 384 374 * When a plugin is activated, the action 'activate_PLUGINNAME' hook is 385 375 * activated. In the name of this hook, PLUGINNAME is replaced with the name of … … 392 382 * 393 383 * @package WordPress 394 384 * @subpackage Plugin 395 * @since 1.5385 * @since 2.0 396 386 * 397 387 * @access private 398 388 * … … 405 395 } 406 396 407 397 /** 408 * Hook a function on a plugin deactivation action hook.398 * register_deactivation_hook() - Hook a function on a plugin deactivation action hook. 409 399 * 410 400 * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is 411 401 * deactivated. In the name of this hook, PLUGINNAME is replaced with the name of … … 431 421 } 432 422 433 423 /** 434 * Build Unique ID for storage and retrieval424 * _wp_filter_build_unique_id() - Build Unique ID for storage and retrieval 435 425 * 436 426 * The old way to serialize the callback caused issues and this function is the 437 427 * solution. It works by checking for objects and creating an a new property in … … 486 476 return $function[0].$function[1]; 487 477 } 488 478 489 ?> 490 No newline at end of file 479 ?>