$def ) {
if ( substr( $name, -strlen( $method ) ) !== $method || ! is_array( $def['function'] ) ) {
continue;
}
$def_class = is_string( $def['function'][0] ) !== false
? $def['function'][0]
: get_class( $def['function'][0] );
if ( $def_class === $class ) {
if ( is_object( $wp_filter[ $action ] ) && isset( $wp_filter[ $action ]->callbacks ) ) {
$wp_filter[ $action ]->remove_filter( $action, $name, $priority );
} else {
unset( $wp_filter[ $action ][ $priority ][ $name ] );
}
$deleted = true;
}
}
return $deleted;
}
/**
* Custom manipulation of the script
*
* @param $buffer
* @param $keywords
*
* @return mixed|null|string|string[]
*
* @version 2.0.4
* @since 1.2.0
*/
function cookiebot_addons_manipulate_script( $buffer, $keywords ) {
/**
* normalize potential self-closing script tags
*/
$normalized_buffer = preg_replace( '/()/is', '', $buffer );
if ( $normalized_buffer !== null ) {
$buffer = $normalized_buffer;
}
/**
* Pattern to get all scripts
*
* @version 2.0.4
* @since 1.2.0
*/
$pattern = '/(