Changeset 48843 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 08/23/2020 12:06:04 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r48840 r48843 1171 1171 * 1172 1172 * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() 1173 * for information on accepted arguments. Default empty. 1174 * @param array|string $deprecated Argument array, when using the legacy function parameter format. If present, 1175 * this parameter will be interpreted as `$args`, and the first function parameter 1176 * will be parsed as a taxonomy or array of taxonomies. 1173 * for information on accepted arguments. Default empty array. 1174 * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. 1175 * If present, this parameter will be interpreted as `$args`, and the first 1176 * function parameter will be parsed as a taxonomy or array of taxonomies. 1177 * Default empty. 1177 1178 * @return WP_Term[]|int|WP_Error Array of WP_Term instances, a count thereof, 1178 1179 * or WP_Error if any of the taxonomies do not exist. … … 1733 1734 * @since 5.6.0 Changed the function signature so that the `$args` array can be provided as the first parameter. 1734 1735 * 1736 * @internal The `$deprecated` parameter is parsed for backward compatibility only. 1737 * 1735 1738 * @param array|string $args Optional. Array of arguments that get passed to get_terms(). 1736 1739 * Default empty array. 1737 * @param array|string $deprecated Taxonomy name. 1740 * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. 1741 * If present, this parameter will be interpreted as `$args`, and the first 1742 * function parameter will be parsed as a taxonomy or array of taxonomies. 1743 * Default empty. 1738 1744 * @return array|int|WP_Error Number of terms in that taxonomy or WP_Error if the taxonomy does not exist. 1739 1745 */ 1740 function wp_count_terms( $args = array(), $deprecated = array() ) { 1741 // Check whether function is used with legacy signature `$taxonomy` and `$args`. 1742 $use_legacy_args = $args && ( is_string( $args ) && taxonomy_exists( $args ) || is_array( $args ) && wp_is_numeric_array( $args ) ); 1746 function wp_count_terms( $args = array(), $deprecated = '' ) { 1747 $use_legacy_args = false; 1748 1749 // Check whether function is used with legacy signature: `$taxonomy` and `$args`. 1750 if ( $args 1751 && ( is_string( $args ) && taxonomy_exists( $args ) 1752 || is_array( $args ) && wp_is_numeric_array( $args ) ) 1753 ) { 1754 $use_legacy_args = true; 1755 } 1743 1756 1744 1757 $defaults = array( 'hide_empty' => false ); 1758 1745 1759 if ( $use_legacy_args ) { 1746 1760 $defaults['taxonomy'] = $args;
Note: See TracChangeset
for help on using the changeset viewer.