You appear to be a bot. Output may be restricted
Description
Replace a filter function with one of our own ( WordPress 4.7 )
Usage
bw_replace_filter( $tag, $function_to_replace, $priority, $new_function );
Parameters
- $tag
- ( string ) required – the filter name e.g. 'the_content'
- $function_to_replace
- ( callable ) required – the name of the filter function to remove (well, replace)
- $priority
- ( integer ) optional default: 10 – the priority of the function. This has to match
- $new_function
- ( string ) optional default: bw_disabled_filter – the replacement function
Returns
voidSource
File name: oik/includes/oik-filters.incLines:
1 to 10 of 10
function bw_replace_filter( $tag, $function_to_replace, $priority=10, $new_function="bw_disabled_filter" ) { global $wp_filter; $function_key = _wp_filter_build_unique_id( $tag, $function_to_replace, false ); $r = isset( $wp_filter[$tag][$priority][$function_key] ); if ( $r ) { $wp_hook_object = $wp_filter[$tag]; $wp_hook_object->callbacks[$priority][$function_key]['replaced'] = $function_to_replace; $wp_hook_object->callbacks[$priority][$function_key]['function'] = $new_function; } }View on GitHub View on Trac