Support

Account

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