Make WordPress Core

Changeset 31638


Ignore:
Timestamp:
03/06/2015 08:04:32 AM (9 years ago)
Author:
DrewAPicture
Message:

Correct the $number argument description in get_terms() to reflect that an empty string or 0 will return all possible results, not -1.

Previously, it was noted that -1 would return all possible results. However, as the value of $number is passed through absint(), -1 would actually be converted to 1, thereby producing unexpected results.

Props iandunn.
Fixes #31526.

File:
1 edited

Legend:

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

    r31581 r31638  
    15921592 *                                           along with all of their descendant terms. If $include is
    15931593 *                                           non-empty, $exclude_tree is ignored. Default empty array.
    1594  *     @type int          $number            Maximum number of terms to return. Accepts 1+ or -1 (all).
    1595  *                                           Default -1.
     1594 *     @type int|string   $number            Maximum number of terms to return. Accepts ''|0 (all) or any
     1595 *                                           positive number. Default ''|0 (all).
     1596 *                                           Default ''|0 (all).
    15961597 *     @type int          $offset            The number by which to offset the terms query. Default empty.
    15971598 *     @type string       $fields            Term fields to query for. Accepts 'all' (returns an array of
Note: See TracChangeset for help on using the changeset viewer.