Title: ACF Shortcode Variable shows error
Last modified: July 24, 2018

---

# ACF Shortcode Variable shows error

 *  Resolved [Don Betts](https://wordpress.org/support/users/dbetts/)
 * (@dbetts)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-shortcode-variable-shows-error/)
 * Hi,
 * I’m using ACF to supply the url for the fileurl parameter of the shortcode. I
   have the filed set to return the file url and the player shows and the file plays
   when clicked, so all is working, but I get the following error:
 * > Compact Audio Player Error! You must enter the mp3 file URL via the “fileurl”
   > parameter in this shortcode. Please check the documentation and correct the
   > mistake.
 * Here’s my code in the tmeplate:
    `<?php echo do_shortcode( '[sc_embed_player 
   fileurl="'.get_sub_field('track_sample').'"]' ); ?>`
 * The shortcode is pulling in the correct url, but still getting the error message.
 * Any insight appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Facf-shortcode-variable-shows-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Don Betts](https://wordpress.org/support/users/dbetts/)
 * (@dbetts)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-shortcode-variable-shows-error/#post-10524456)
 * Update: the message goes away when I add a second file (using the ACF Repeater).
   In this case, I will always have more than one file, but still curious about 
   why I got the message.
 * Thanks
 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/acf-shortcode-variable-shows-error/#post-10524760)
 * Hi, what if you try the following sample code.
 * `<?php echo do_shortcode('[sc_embed_player fileurl="URL OF THE MP3 FILE"]'); ?
   >`
 * Does the above work for you?
 * Regards
 *  Thread Starter [Don Betts](https://wordpress.org/support/users/dbetts/)
 * (@dbetts)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/acf-shortcode-variable-shows-error/#post-10526277)
 * That worked to remove the message.
 * Also, when I switch back to my original code and only input one file in the ACF
   repeater it no longer gives the warning.
 * Thanks for the help – marking resolved.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘ACF Shortcode Variable shows error’ is closed to new replies.

 * ![](https://ps.w.org/compact-wp-audio-player/assets/icon-128x128.png?rev=994411)
 * [Compact WP Audio Player](https://wordpress.org/plugins/compact-wp-audio-player/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/compact-wp-audio-player/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/compact-wp-audio-player/)
 * [Active Topics](https://wordpress.org/support/plugin/compact-wp-audio-player/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/compact-wp-audio-player/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/compact-wp-audio-player/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [Don Betts](https://wordpress.org/support/users/dbetts/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/acf-shortcode-variable-shows-error/#post-10526277)
 * Status: resolved