[wp-hackers] the right hook for custom content

Simon Wheatley simon at sweetinteraction.com
Tue Mar 17 14:36:35 GMT 2009


On Tue, Mar 17, 2009 at 2:17 PM, Austin Matzko <if.website at gmail.com> wrote:
>
> What I do for situations like this is add a rewrite tag for the query
> var, in a callback for the init action.
>
> add_action('init', 'my_init');
> add_action('parse_query', 'my_parser');
>
> function my_init() {
> global $wp;
> $wp->add_query_var('custom_content_id');
> }
>

Do you need to flush rewrite rules after doing something like that?
Not flushing (ahem) was something which caught me out when creating
custom taxonomies recently.

S


---
Sweet Interaction Ltd is Registered in England/Wales, no. 6610741
Registered office: 7 Malton Av, Manchester, M21 8AT


More information about the wp-hackers mailing list