Make WordPress Core


Ignore:
Timestamp:
11/09/2016 10:59:02 PM (8 years ago)
Author:
johnbillion
Message:

Docs: Improve the documentation for parameters which accept OBJECT, ARRAY_A, and ARRAY_N as parameters.

See #37770

File:
1 edited

Legend:

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

    r39175 r39188  
    402402 *
    403403 * @param mixed  $args   Optional. User defined arguments for replacing the defaults. Default empty.
    404  * @param string $output Optional. Constant for return type. Accepts OBJECT, ARRAY_A, ARRAY_N.
    405  *                       Default OBJECT.
     404 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     405 *                       a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    406406 * @return array Array of children, where the type of each element is determined by $output parameter.
    407407 *               Empty array on failure.
     
    506506 *
    507507 * @param int|WP_Post|null $post   Optional. Post ID or post object. Defaults to global $post.
    508  * @param string           $output Optional, default is Object. Accepts OBJECT, ARRAY_A, or ARRAY_N.
    509  *                                 Default OBJECT.
     508 * @param string           $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     509 *                                 a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    510510 * @param string           $filter Optional. Type of filter to apply. Accepts 'raw', 'edit', 'db',
    511511 *                                 or 'display'. Default 'raw'.
     
    28632863 * @see get_posts()
    28642864 *
    2865  * @param array  $args       Optional. Arguments to retrieve posts. Default empty array.
    2866  * @param string $output     Optional. Type of output. Accepts ARRAY_A or ''. Default ARRAY_A.
    2867  * @return array|false Associative array if $output equals ARRAY_A, array or false if no results.
     2865 * @param array  $args   Optional. Arguments to retrieve posts. Default empty array.
     2866 * @param string $output Optional. The required return type. One of OBJECT or ARRAY_A, which correspond to
     2867 *                       a WP_Post object or an associative array, respectively. Default ARRAY_A.
     2868 * @return array|false Array of recent posts, where the type of each element is determined by $output parameter.
     2869 *                     Empty array on failure.
    28682870 */
    28692871function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
     
    41914193 *
    41924194 * @param mixed  $page   Page object or page ID. Passed by reference.
    4193  * @param string $output Optional. What to output. Accepts OBJECT, ARRAY_A, or ARRAY_N.
    4194  *                       Default OBJECT.
     4195 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     4196 *                       a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    41954197 * @param string $filter Optional. How the return value should be filtered. Accepts 'raw',
    41964198 *                       'edit', 'db', 'display'. Default 'raw'.
    4197  * @return WP_Post|array|null WP_Post on success or null on failure.
     4199 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
    41984200 */
    41994201function get_page( $page, $output = OBJECT, $filter = 'raw') {
     
    42094211 *
    42104212 * @param string       $page_path Page path.
    4211  * @param string       $output    Optional. Output type. Accepts OBJECT, ARRAY_N, or ARRAY_A.
    4212  *                                Default OBJECT.
     4213 * @param string       $output    Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     4214 *                                a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    42134215 * @param string|array $post_type Optional. Post type or array of post types. Default 'page'.
    4214  * @return WP_Post|array|void WP_Post on success.
     4216 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
    42154217 */
    42164218function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
     
    43014303 *
    43024304 * @param string       $page_title Page title
    4303  * @param string       $output     Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A.
    4304  *                                 Default OBJECT.
     4305 * @param string       $output     Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     4306 *                                 a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    43054307 * @param string|array $post_type  Optional. Post type or array of post types. Default 'page'.
    4306  * @return WP_Post|array|void WP_Post on success or null on failure
     4308 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
    43074309 */
    43084310function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) {
Note: See TracChangeset for help on using the changeset viewer.