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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31638 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2015-03-06 08:04:32 +00:00
parent 1080a903fc
commit 653f2ee36e
1 changed files with 3 additions and 2 deletions

View File

@ -1591,8 +1591,9 @@ function get_term_to_edit( $id, $taxonomy ) {
* @type array|string $exclude_tree Array or comma/space-separated string of term ids to exclude
* along with all of their descendant terms. If $include is
* non-empty, $exclude_tree is ignored. Default empty array.
* @type int $number Maximum number of terms to return. Accepts 1+ or -1 (all).
* Default -1.
* @type int|string $number Maximum number of terms to return. Accepts ''|0 (all) or any
* positive number. Default ''|0 (all).
* Default ''|0 (all).
* @type int $offset The number by which to offset the terms query. Default empty.
* @type string $fields Term fields to query for. Accepts 'all' (returns an array of
* term objects), 'ids' or 'names' (returns an array of integers