hook
Filter HookDescription
The plugin API is located in this file, which allows for creating actions and filters and hooking functions, and methods. The functions or methods will then be run when the action or filter is called. The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways. Any of the syntaxes explained in the PHP documentation for the {@link https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid. Also see the {@link https://developer.wordpress.org/plugins/ Plugin API} for more information and examples on how to use a lot of these functions. This file should have no external dependencies.Hook Information
File Location |
wp-includes/plugin.php
View on GitHub
|
Hook Type | Filter |
Line Number | 87 |
Hook Parameters
This hook doesn't accept any parameters.
Usage Examples
Basic Usage
<?php
// Hook into hook
add_filter('hook', 'my_custom_filter');
function my_custom_filter() {
// Your custom filtering logic here
return 'modified_value';
}
Source Code Context
wp-includes/plugin.php:87
- How this hook is used in WordPress core
<?php
82 * the `$accepted_args` value must reflect the number of arguments the bound callback *actually*
83 * opted to accept. If no arguments were accepted by the callback that is considered to be the
84 * same as accepting 1 argument. For example:
85 *
86 * // Filter call.
87 * $value = apply_filters( 'hook', $value, $arg2, $arg3 );
88 *
89 * // Accepting zero/one arguments.
90 * function example_callback() {
91 * ...
92 * return 'some value';
PHP Documentation
<?php
/**
* The plugin API is located in this file, which allows for creating actions
* and filters and hooking functions, and methods. The functions or methods will
* then be run when the action or filter is called.
*
* The API callback examples reference functions, but can be methods of classes.
* To hook methods, you'll need to pass an array one of two ways.
*
* Any of the syntaxes explained in the PHP documentation for the
* {@link https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'}
* type are valid.
*
* Also see the {@link https://developer.wordpress.org/plugins/ Plugin API} for
* more information and examples on how to use a lot of these functions.
*
* This file should have no external dependencies.
*
* @package WordPress
* @subpackage Plugin
* @since 1.5.0
*/
Quick Info
- Hook Type: Filter
- Parameters: 0
- File: wp-includes/plugin.php
Related Hooks
Related hooks will be displayed here in future updates.