[wp-hackers] embed shortcode

Otto otto at ottodestruct.com
Thu Sep 16 17:00:34 UTC 2010


The embed shortcode works differently than other shortcodes. It only
gets added to the available shortcodes processing list during the call
to the_content, so you can't use it outside of this context. This is
for security reasons.

So yes, use the wp_get_oembed function instead.

-Otto



On Thu, Sep 16, 2010 at 11:41 AM, Ashish Saini
<ashishsainiashfame at gmail.com> wrote:
> Hi,
>
> I am trying to use this in a template :
>
> $fire = '[embed width="427"]'.$prs_spec["video"].'[/embed]';
> echo do_shortcode($fire);
>
> But it just displays the content of $fire.
>
> Even echo do_shortcode('[embed]
> http://www.youtube.com/watch?v=MuaBAe-lqdg[/embed]'); didn't work.
>
> How can I use embed shortcode anywhere on the theme?
>
> Thanks & Regards
> Ashish Saini aka Ashfame
> (Deserve Before You Desire)
> Homepage : http://www.ashfame.com | Blog : http://blog.ashfame.com | Twitter
> : http://twitter.com/ashfame
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list