0

I have downloaded a plugin called Stream Video Player, which has a shortcode. If I put the shortcode into the content editor, it works well and it displays the video. However, if, inside a template I am creating, I call it through the do_shortcode() function, it doesn't work, it just shows the text [stream bla bla]. Can anyone help me and tell me why this is happening?

3
  • Did you do echo do_shortcode('[stream blah blah]'); do_shortcode returns a strings!
    – keatch
    Commented May 5, 2011 at 9:10
  • Yes, I do the following: echo do_shortcode("[stream flv=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 mp4=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 provider=video img=xxx.es/wp-content/uploads/2011/04/previo-video.jpg embed=false share=false width=500 height=333 dock=true controlbar=over bandwidth=high autostart=false opfix=true /]");
    – DarthRoman
    Commented May 5, 2011 at 9:21
  • 1
    many plugins don't use 'real' shortcode, but use regular expressions code to extract the function from the content. in this case, 'do_shortcode() cannot work; and you need to look through the plugin documentation or the plugin code, and try to find a function that you can call directly in the template.
    – Michael
    Commented May 5, 2011 at 9:48

1 Answer 1

1

It's not really a shortcode, its a content filter but you can try calling the plugins function directly:

if (function_exists('StreamVideo_Parse_content')){
   echo StreamVideo_Parse_content("[stream flv=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 mp4=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 provider=video img=xxx.es/wp-content/uploads/2011/04/previo-video.jpg embed=false share=false width=500 height=333 dock=true controlbar=over bandwidth=high autostart=false opfix=true /]");
}
1
  • Glad I could help
    – Bainternet
    Commented May 5, 2011 at 14:24

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.