@filipeos
WordPress cached embed data responses in the postmen table, it’s likely the at the function you are calling is being bypassed and cached data are being used. Try this query in PHPMyAdmin and check the stored data, I bet the ‘dot’ tags are in there.
SELECT * FROM
wp_postmetaWHERE
meta_keyLIKE '%_oembed%'
You can delete those keys to force a refresh and check that your filter is working.
Hi,
I got:
[25-Apr-2020 12:23:52 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function dl_oembed(), 1 passed in /home4/choseni1/public_html/XXX/wp-includes/class-wp-hook.php on line 289 and exactly 3 expected in /home4/choseni1/public_html/XXX/wp-content/themes/powerlift-child/functions.php:151
Stack trace:
#0 /home4/choseni1/public_html/XXX/wp-includes/class-wp-hook.php(289): dl_oembed('https://vimeo.c...')
#1 /home4/choseni1/public_html/XXX/wp-includes/plugin.php(206): WP_Hook->apply_filters('https://vimeo.c...', Array)
#2 /home4/choseni1/public_html/XXX/wp-includes/class-wp-oembed.php(536): apply_filters('oembed_fetch_ur...', 'https://vimeo.c...', 'https://vimeo.c...', Array)
#3 /home4/choseni1/public_html/XXX/wp-includes/class-wp-oembed.php(355): WP_oEmbed->fetch('https://vimeo.c...', 'https://vimeo.c...', Array)
#4 /home4/choseni1/public_html/XXX/wp-includes/class-wp-oembed.php(400): WP_oEmbed->get_data('https://vimeo.c...', Array)
#5 /home4/choseni1/public_html/ in /home4/choseni1/public_html/XXX/wp-content/themes/powerlift-child/functions.php on line 151
for the code:
function dl_oembed ( $provider, $url, $args ) {
if ( strpos( $provider, 'vimeo.com' ) !== false)
$provider = remove_query_arg( 'dnt', $provider );
return $provider;
}
add_filter( 'oembed_fetch_url', 'dl_oembed' );
Yes, that code would be incorrect.
This would work:
function dl_oembed ( $provider, $url, $args ) {
if ( strpos( $provider, 'vimeo.com' ) !== false)
$provider = remove_query_arg( 'dnt', $provider );
return $provider;
}
add_filter( 'oembed_fetch_url', 'dl_oembed', 10, 3);
The missing 10,3 would be the problem.