[wp-hackers] Passin parameters to WP functions

Dougal Campbell dougal at gunters.org
Tue Nov 22 15:13:55 GMT 2005


Stefano wrote:
> it's possible and if yes how to pass parametres to a wp fuunction?
> 
> I wanna pass to wp_list_pages() function an ID for the child_of
> option, I've tried different sintax (I have the ID in a variable named
> $menu_ID but with no fortune.
> 
> I put the parametres into a string passed to the function like in
> wp_list_pages($param); but it acts like the title_li= (that's a space
> to not show parent page doens't works.
> 
> Any help? Thanks in advance

This is documented in the Codex:

   http://codex.wordpress.org/Template_Tags/wp_list_pages

   wp_list_pages("child_of=$menu_ID");

If you need to pass more than one option, you might also want to review 
this page:

 
http://codex.wordpress.org/Template_Tags/How_to_Pass_Tag_Parameters#Tags_with_query-string-style_parameters



-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-hackers mailing list