Leveraging AI to Supercharge Your WordPress Business Website
In today’s competitive digital landscape, every business website needs an edge to...
22.May.2021 | Code Snippets, Wordpress
A quick snipped of code filter parameters into YouTube oEmbed requests.
Handy to remove suggested videos, YouTube contols and info. Paste this into your functions.php file
function custom_youtube_querystring( $html, $url, $attr, $post_id ) {
if (strpos($html, 'youtube')!= FALSE || strpos($html, 'youtu.be') != FALSE) {
$args = [
'rel' => 0,
'controls' => 0,
'showinfo' => 0,
'modestbranding' => 1,
];
$params = '?feature=oembed&';
foreach ($args as $arg => $value) {
$params .= $arg;
$params .= '=';
$params .= $value;
$params .= '&';
}
$html = str_replace( '?feature=oembed', $params, $html );
}
return $html;
}
add_filter('embed_oembed_html', 'custom_youtube_querystring', 10, 4);Coding Tips, Wordpress, Wordpress Function, WordPress Tips
Share

In today’s competitive digital landscape, every business website needs an edge to...

WordPress has come a long way since its humble beginnings in 2003....

In the ever-evolving landscape of website development, staying ahead of the curve...
Handy bit of code you can use in your custom templates that grabs the all the page or post data by ID:...
Commonly asked eCommerce questions: A nice little bit of information about #PCIDSS for @WooCommerce - http://goo.gl/BSK6Ba Lee Harris - Twitter...
I came across this when looking for a purpose built, fully customisable calendar - https://fullcalendar.io/ Im just starting to work with...