[wp-hackers] plugin developers invited for collaboration
Viper007Bond
viper at viper007bond.com
Sat May 31 00:17:21 GMT 2008
Yes, it'd replace your regex and parsing of the attributes. You could just
do [superslider category="mycat"] and your function would get passed an
array: $atts = array( 'category' => 'mycat' );
You don't need an add_filter() though. It's already added at priority 11 and
loops through all shortcodes.
Check out this very simple plugin of mine for BBCode:
http://wordpress.org/extend/plugins/bbcode/ Note that the content bit is
only for non-self-closing tags (like [mytag]content[/mytag]) and I call
do_shortcode() on my $content so you can have shortcodes within shortcodes.
On Fri, May 30, 2008 at 1:46 PM, Daiv Mowbray <daiv at daivmowbray.com> wrote:
>
> Thanx Viper,
> I was just reading that same page this afternoon.
>
> If I understand correctly, in our case, shortcode would replace:
> $content = preg_replace_callback( "/(<p>)?\[qt:([^]]+)](<\/p>)?/i",
> "my_embed", $content );
>
> with the shortcode call:
> add_shortcode('my-shortcode', 'my_shortcode_handler');
>
> then called by the user with my quicktag button:
> which could insert:
> [my-shortcode foo="bar" baz="bing"]
>
> which then will activate my_shortcode_handler.
>
> Then the my_shortcode_handler will have an add_filter:
> add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1);
>
> Please correct me if I'm misunderstanding something here.
>
>
> On May 30, 2008, at 5:52 PM, Viper007Bond wrote:
>
> You may want to check out this for the [superslider] bit:
>> http://codex.wordpress.org/Shortcode_API
>>
>> On Fri, May 30, 2008 at 8:21 AM, Daiv Mowbray <daiv at daivmowbray.com>
>> wrote:
>>
>>
>>> Good day list.
>>>
>>
>
> ----------
> Daiv Mowbray
> daiv at daivmowbray.com
> ----------
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/
More information about the wp-hackers
mailing list