Support

Account

Home Forums ACF PRO Getting just the url that was entered into an oEmbed field inside a variable Reply To: Getting just the url that was entered into an oEmbed field inside a variable

  • I can’t seem to make this work with my repeater. Here’s my code:

    if(have_rows('videos')): while(have_rows('videos')): the_row();
        $video_embed_url = get_sub_field('video_embed', false, false);
        $thumbnail = get_sub_field('thumbnail');
        $thumbnail_url = $thumbnail['url'];
        echo '<a href="' . $video_embed_url . '"><img src="' . $thumbnail_url . '" /></a>';
    endwhile; endif;

    It’s outputting the whole iframe embed code, not the URL entered into the oEmbed field. Also, nothing changes if I remove ‘false, false’ from that get_sub_field.