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?
-
Did you do echo do_shortcode('[stream blah blah]'); do_shortcode returns a strings!– keatchCommented 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 /]");– DarthRomanCommented May 5, 2011 at 9:21
-
1many 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.– MichaelCommented May 5, 2011 at 9:48
Add a comment
|
1 Answer
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 /]");
}