#52297 closed defect (bug) (invalid)
Custom WP types params - remove or fix to fix inconsistent typing
Reported by: | malthert | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
e.g.
* @return string[]|WP_Taxonomy[] The names or objects of all taxonomies of `$object_type`. */ function get_object_taxonomies($object, $output = 'names')
Returns WP_Taxonomy type.
But functions that are commonly used with this, do not accept this type.
e.g.
* @param string|string[] $taxonomies The taxonomy names to retrieve terms from. * @param array|string $args See WP_Term_Query::__construct() for supported arguments. * @return array|WP_Error The requested term data or empty array if no terms found. * WP_Error if any of the taxonomies don't exist. */ function wp_get_object_terms($object_ids, $taxonomies, $args = array())
$taxonomies does not accept WP_Taxonomy.
In general it's a bad idea to use these custom types like WP_Taxonomy. But if we use it, we must use it consistently, which is not the case currently
Change History (4)
Note: See
TracTickets for help on using
tickets.