Insert ACF Field Variable into Transcoder Shortcode

I’m working on a WordPress site that uses this plugin to convert video files to MP4. The site allows users to post content via an ACF form.

The issue I’m having is I need to pass the ID of the media file into the shortcode. It works fine when I manually enter the ID e.g:

echo do_shortcode('[rt_media attachment_id= 970]');

However when I add a variable to the shortcode nothing is outputted:

$videoid = the_field('select_video_file');
echo do_shortcode('[rt_media attachment_id= '. $videoid .']');

I’m sure it’s got to be something really simple but I can’t workout where I’m going wrong!

Any help/advice would be greatly appreciated.

Thanks in advance,



This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer