Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Did you do echo do_shortcode('[stream blah blah]'); do_shortcode returns a strings! –  keatch May 5 '11 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 May 5 '11 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 May 5 '11 at 9:48

1 Answer 1

up vote 1 down vote accepted

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 /]");
}
share|improve this answer
    
Thank you very much!!! It worked!! –  DarthRoman May 5 '11 at 14:11
    
Glad I could help –  Bainternet May 5 '11 at 14:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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