The Definitive Guide to Setting Up WordPress in 2024: A Bristol Freelance Web Developer’s Essential Setup
In the ever-evolving landscape of website development, staying ahead of the curve...
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 the ever-evolving landscape of website development, staying ahead of the curve...
In the digital realm, your website serves as the cornerstone of your...
In the ever-evolving world of e-commerce, having a robust and flexible platform...
If you’re a start up business, a sole trader or a small business, it is inevitable that you are going...
This snippet of PHP can come in handy for removing the empty spaces in a string. Here is it being...
Need a bespoke WooCommerce site with dynamic content for two types of visitor? For example, this is from a recent...