$def ) {
if ( substr( $name, - $len ) == $method ) {
if ( is_array( $def['function'] ) ) {
if ( is_string( $def['function'][0] ) !== false ) {
$def_class = $def['function'][0];
} else {
$def_class = 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 );
$deleted = true;
} else {
unset( $wp_filter[ $action ][ $priority ][ $name ] );
$deleted = true;
}
}
}
}
}
}
return $deleted;
}
/**
* Custom manipulation of the script
*
* @param $buffer
* @param $keywords
* @param $cookie_type
*
* @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 = '/(