WordPress.org

Make WordPress Core

Changeset 38798


Ignore:
Timestamp:
10/16/2016 01:09:12 AM (21 months ago)
Author:
SergeyBiryukov
Message:

Docs: In get_pages() and wp_list_pages(), note that post_status argument can also be an array.

Adjust the alignment of default argument values for better readability.

Props birgire, desrosj.
Fixes #38136.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r38746 r38798  
    11351135 *     Array or string of arguments. Optional.
    11361136 *
    1137  *     @type int    $child_of     Display only the sub-pages of a single page by ID. Default 0 (all pages).
    1138  *     @type string $authors      Comma-separated list of author IDs. Default empty (all authors).
    1139  *     @type string $date_format  PHP date format to use for the listed pages. Relies on the 'show_date' parameter.
    1140  *                                Default is the value of 'date_format' option.
    1141  *     @type int    $depth        Number of levels in the hierarchy of pages to include in the generated list.
    1142  *                                Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to
    1143  *                                the given n depth). Default 0.
    1144  *     @type bool   $echo         Whether or not to echo the list of pages. Default true.
    1145  *     @type string $exclude      Comma-separated list of page IDs to exclude. Default empty.
    1146  *     @type array  $include      Comma-separated list of page IDs to include. Default empty.
    1147  *     @type string $link_after   Text or HTML to follow the page link label. Default null.
    1148  *     @type string $link_before  Text or HTML to precede the page link label. Default null.
    1149  *     @type string $post_type    Post type to query for. Default 'page'.
    1150  *     @type string $post_status  Comma-separated list of post statuses to include. Default 'publish'.
    1151  *     @type string $show_date    Whether to display the page publish or modified date for each page. Accepts
    1152  *                                'modified' or any other value. An empty value hides the date. Default empty.
    1153  *     @type string $sort_column  Comma-separated list of column names to sort the pages by. Accepts 'post_author',
    1154  *                                'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt',
    1155  *                                'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'.
    1156  *     @type string $title_li     List heading. Passing a null or empty value will result in no heading, and the list
    1157  *                                will not be wrapped with unordered list `<ul>` tags. Default 'Pages'.
    1158  *     @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
    1159  *     @type Walker $walker       Walker instance to use for listing pages. Default empty (Walker_Page).
     1137 *     @type int          $child_of     Display only the sub-pages of a single page by ID. Default 0 (all pages).
     1138 *     @type string       $authors      Comma-separated list of author IDs. Default empty (all authors).
     1139 *     @type string       $date_format  PHP date format to use for the listed pages. Relies on the 'show_date' parameter.
     1140 *                                      Default is the value of 'date_format' option.
     1141 *     @type int          $depth        Number of levels in the hierarchy of pages to include in the generated list.
     1142 *                                      Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to
     1143 *                                      the given n depth). Default 0.
     1144 *     @type bool         $echo         Whether or not to echo the list of pages. Default true.
     1145 *     @type string       $exclude      Comma-separated list of page IDs to exclude. Default empty.
     1146 *     @type array        $include      Comma-separated list of page IDs to include. Default empty.
     1147 *     @type string       $link_after   Text or HTML to follow the page link label. Default null.
     1148 *     @type string       $link_before  Text or HTML to precede the page link label. Default null.
     1149 *     @type string       $post_type    Post type to query for. Default 'page'.
     1150 *     @type string|array $post_status  Comma-separated list or array of post statuses to include. Default 'publish'.
     1151 *     @type string       $show_date    Whether to display the page publish or modified date for each page. Accepts
     1152 *                                      'modified' or any other value. An empty value hides the date. Default empty.
     1153 *     @type string       $sort_column  Comma-separated list of column names to sort the pages by. Accepts 'post_author',
     1154 *                                      'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt',
     1155 *                                      'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'.
     1156 *     @type string       $title_li     List heading. Passing a null or empty value will result in no heading, and the list
     1157 *                                      will not be wrapped with unordered list `<ul>` tags. Default 'Pages'.
     1158 *     @type string       $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'.
     1159 *                                      Default 'preserve'.
     1160 *     @type Walker       $walker       Walker instance to use for listing pages. Default empty (Walker_Page).
    11601161 * }
    11611162 * @return string|void HTML list of pages.
     
    11631164function wp_list_pages( $args = '' ) {
    11641165    $defaults = array(
    1165         'depth' => 0, 'show_date' => '',
    1166         'date_format' => get_option( 'date_format' ),
    1167         'child_of' => 0, 'exclude' => '',
    1168         'title_li' => __( 'Pages' ), 'echo' => 1,
    1169         'authors' => '', 'sort_column' => 'menu_order, post_title',
    1170         'link_before' => '', 'link_after' => '', 'item_spacing' => 'preserve', 'walker' => '',
     1166        'depth'        => 0,
     1167        'show_date'    => '',
     1168        'date_format'  => get_option( 'date_format' ),
     1169        'child_of'     => 0,
     1170        'exclude'      => '',
     1171        'title_li'     => __( 'Pages' ),
     1172        'echo'         => 1,
     1173        'authors'      => '',
     1174        'sort_column'  => 'menu_order, post_title',
     1175        'link_before'  => '',
     1176        'link_after'   => '',
     1177        'item_spacing' => 'preserve',
     1178        'walker'       => '',
    11711179    );
    11721180
  • trunk/src/wp-includes/post.php

    r38634 r38798  
    44004400 *                                      Default 0.
    44014401 *     @type string       $post_type    The post type to query. Default 'page'.
    4402  *     @type string       $post_status  A comma-separated list of post status types to include.
     4402 *     @type string|array $post_status  A comma-separated list or array of post statuses to include.
    44034403 *                                      Default 'publish'.
    44044404 * }
     
    44094409
    44104410    $defaults = array(
    4411         'child_of' => 0, 'sort_order' => 'ASC',
    4412         'sort_column' => 'post_title', 'hierarchical' => 1,
    4413         'exclude' => array(), 'include' => array(),
    4414         'meta_key' => '', 'meta_value' => '',
    4415         'authors' => '', 'parent' => -1, 'exclude_tree' => array(),
    4416         'number' => '', 'offset' => 0,
    4417         'post_type' => 'page', 'post_status' => 'publish',
     4411        'child_of'     => 0,
     4412        'sort_order'   => 'ASC',
     4413        'sort_column'  => 'post_title',
     4414        'hierarchical' => 1,
     4415        'exclude'      => array(),
     4416        'include'      => array(),
     4417        'meta_key'     => '',
     4418        'meta_value'   => '',
     4419        'authors'      => '',
     4420        'parent'       => -1,
     4421        'exclude_tree' => array(),
     4422        'number'       => '',
     4423        'offset'       => 0,
     4424        'post_type'    => 'page',
     4425        'post_status'  => 'publish',
    44184426    );
    44194427
Note: See TracChangeset for help on using the changeset viewer.