Home › Forums › General Issues › oEmbed button color › Reply To: oEmbed button color
So, I posted this before I found: https://www.advancedcustomfields.com/resources/oembed/
The section entitled “Display value with additional attributes” is the exact code I am using. I can now control the button color 🙂
The code I am using looks like:
<?php
$video = get_sub_field('video');
preg_match('/src="(.+?)"/', $video, $matches);
$src = $matches[1];
$params = array(
'color' => f1d925
);
$new_src = add_query_arg($params, $src);
$video = str_replace($src, $new_src, $video);
$attributes = 'frameborder="0"';
$video = str_replace('></iframe>', ' ' . $attributes . '></iframe>', $video);
echo '<div class="video">'.$video.'</div>';
?>
Thanks,
Josh
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.