Uses
| Uses | Description |
|---|---|
| wp-includes/class-wp-hook.php: WP_Hook::resort_active_iterations() | Handles resetting callback priority keys mid-iteration. |
| wp-includes/plugin.php: _wp_filter_build_unique_id() | Build Unique ID for storage and retrieval. |
Unhooks a function or method from a specific filter action.
(string) (Required) The filter hook to which the function to be removed is hooked.
(callable) (Required) The callback to be removed from running when the filter is applied.
(int) (Required) The exact priority used when adding the original filter callback.
(bool) Whether the callback existed before it was removed.
File: wp-includes/class-wp-hook.php
public function remove_filter( $tag, $function_to_remove, $priority ) {
$function_key = _wp_filter_build_unique_id( $tag, $function_to_remove, $priority );
$exists = isset( $this->callbacks[ $priority ][ $function_key ] );
if ( $exists ) {
unset( $this->callbacks[ $priority ][ $function_key ] );
if ( ! $this->callbacks[ $priority ] ) {
unset( $this->callbacks[ $priority ] );
if ( $this->nesting_level > 0 ) {
$this->resort_active_iterations();
}
}
}
return $exists;
} | Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_hook/remove_filter