0

I am trying to dynamically load a video in the media library using the built in MediaElement player. To do this, I am using the do_shortcode() function to run the [video] shortcode and build up the necessary divs and such.

However, no matter what I do, the do_shortcode() with [video] only returns a href link and not the video player. Any suggestions?

<?php echo do_shortcode("[video src= 'link_to_my_video.mp4 ']"); ?>

1 Answer 1

0

Wordpress has this little minimally documented function, wp_video_shortcode()

Just pass an array with the necessary information as if you were writing out the shortcode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.