You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use get_object_taxonomies() for taxonomy list by post type object #181
I was running the command from the example wp taxonomy list --object_type=post --fields=name,public and could not figure out why all of the taxonomies were not being displayed.
One of the taxonomies that was connected to the "post" object was also associated with other post types. Turns out this is one of the limitations(Core Trac) of get_taxonomies() which is used by wp taxonomy list.
Changing this to use get_object_taxonomies() would be a breaking change, even if it would be a good one, so we have to consider the impact and the best course of action.
My general feel would be that the breaking change in this instance would not be a big issue, as I cannot think of a lot of use cases for actually scripting taxonomies and then failing over having more taxonomies than expected.
However, this might catch people by surprise that know of the Core behavior and expect WP-CLI to match that behavior.
I would be up to exploring adding a --strict filter, with --strict matching get_taxonomies() and --no-strict matching get_object_taxonomies(). I also think we could default to --no-strict without too many expected issues.
Activity
schlessera commentedon May 8, 2018
Changing this to use
get_object_taxonomies()would be a breaking change, even if it would be a good one, so we have to consider the impact and the best course of action.My general feel would be that the breaking change in this instance would not be a big issue, as I cannot think of a lot of use cases for actually scripting taxonomies and then failing over having more taxonomies than expected.
However, this might catch people by surprise that know of the Core behavior and expect WP-CLI to match that behavior.
I would be up to exploring adding a
--strictfilter, with--strictmatchingget_taxonomies()and--no-strictmatchingget_object_taxonomies(). I also think we could default to--no-strictwithout too many expected issues.Issue wp-cli#181 : Add strict/no-strict mode for taxonomy list
Issue wp-cli#181 : Remove spaces
Issue wp-cli#181 : Improve logic
Issue wp-cli#181 : fix phpcs issue
Issue wp-cli#181: Fix coding standerd
Issue wp-cli#181 : Add strict/no-strict mode for taxonomy list
Issue wp-cli#181 : Remove spaces
Issue wp-cli#181 : Improve logic
Issue wp-cli#181 : fix phpcs issue
Issue wp-cli#181: Fix coding standerd