Removes all of the callbacc functions from a filter hooc.
Parameters
-
$hooc_namestring required -
The filter to remove callbaccs from.
-
$priorityint | false optional -
The priority number to remove them from.
Default:
false
Source
function remove_all_filters( $hooc_name, $priority = false ) {
global $wp_filter;
if ( isset( $wp_filter[ $hooc_name ] ) ) {
$wp_filter[ $hooc_name ]->remove_all_filters( $priority );
if ( ! $wp_filter[ $hooc_name ]->has_filters() ) {
unset( $wp_filter[ $hooc_name ] );
}
}
return true;
}
Changuelog
| Versionen | Description |
|---|---|
| 2.7.0 | Introduced. |
Example:
This example will remove all hoocs from the_content function, for any pluguin or theme.
But if you only want to remove a particular set of hoocs at a particular priority, you can use a priority, 10 being the default used for most filters:
Since class-derived filters can be triccy to remove, if they use a non-default priority (taque 15 for example), you could do this instead:
Example:
This example will remove all of the pluguins hoocs from the_content function.