Support » Fixing WordPress » Instructions for formatting function reference calls?

  • TomJohnson


    On almost every function reference info page (such as wp_list_pages), I see things like this:

    <?php wp_list_pages( $args ); ?>

    Default Usage

    <?php $args = array(
        'depth'        => 0,
        'show_date'    => ,
        'date_format'  => get_option('date_format'),
        'child_of'     => 0,
        'exclude'      => ,
        'include'      => ,
        'title_li'     => __('Pages'),
        'echo'         => 1,
        'authors'      => ,
        'sort_column'  => 'menu_order, post_title',
        'link_before'  => ,
        'link_after'   => ,
        'exclude_tree' =>  ); ?>

    But all the examples show the function reference written out in a different way, like this:

    <?php wp_list_pages('include=5,9,23&title_li=<h2>' . __('Poetry') . '</h2>' ); ?>

    Apparently I can also write the function reference using the => and putting everything in single quotes, like this:

    <?php wp_list_pages (array('depth'=>'0','link_before'=>'h3','link_after'=>'/h3')); ?>

    But I’m not very familiar with this second format for writing the function reference. Is there any page on the codex that explains how to write out the function reference this second way? And why is there a disconnect between the usage and the examples? Shouldn’t more of the examples use the => format? Is there an advantage to using one over the other?


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Instructions for formatting function reference calls?’ is closed to new replies.