240 | | * @param array|string $args Array or query string of arguments for registering a taxonomy. |
| 240 | * @param array|string $args { |
| 241 | * Array or query string of arguments for registering a taxonomy. |
| 242 | * |
| 243 | * @type array $labels An array of labels for this taxonomy. By default, Tag labels are |
| 244 | * used for non-hierarchical taxonomies, and Category labels are used |
| 245 | * for hierarchical taxonomies. See accepted values in |
| 246 | * get_taxonomy_labels(). Default empty array. |
| 247 | * @type string $description A short descriptive summary of what the taxonomy is for. Default |
| 248 | * empty. |
| 249 | * @type bool $public Whether a taxonomy is intended for use publicly either via |
| 250 | * the admin interface or by front-end users. The default settings |
| 251 | * of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus` |
| 252 | * are inherited from `$public`. |
| 253 | * @type bool $publicly_queryable Whether the taxonomy is publicly queryable. |
| 254 | * If not set, the default is inherited from `$public` |
| 255 | * @type bool $hierarchical Whether the taxonomy is hierarchical. Default false. |
| 256 | * @type bool $show_ui Whether to generate and allow a UI for managing terms in this |
| 257 | * taxonomy in the admin. If not set, the default is inherited from |
| 258 | * `$public` (default true). |
| 259 | * @type bool $show_in_menu Whether to show the taxonomy in the admin menu. If true, the |
| 260 | * taxonomy is shown as a submenu of the object type menu. If false, |
| 261 | * no menu is shown. `$show_ui` must be true. If not set, default is |
| 262 | * inherited from `$show_ui` (default true). |
| 263 | * @type bool $show_in_nav_menus Makes this taxonomy available for selection in navigation menus. If |
| 264 | * not set, the default is inherited from `$public` (default true). |
| 265 | * @type bool $show_in_rest Whether to include the taxonomy in the REST API. |
| 266 | * @type string $rest_base To change the base url of REST API route. Default is $taxonomy. |
| 267 | * @type string $rest_controller_class REST API Controller class name. Default is |
| 268 | * 'WP_REST_Terms_Controller'. |
| 269 | * @type bool $show_tagcloud Whether to list the taxonomy in the Tag Cloud Widget controls. If |
| 270 | * not set, the default is inherited from `$show_ui` (default true). |
| 271 | * @type bool $show_in_quick_edit Whether to show the taxonomy in the quick/bulk edit panel. It not |
| 272 | * set, the default is inherited from `$show_ui` (default true). |
| 273 | * @type bool $show_admin_column Whether to display a column for the taxonomy on its post type |
| 274 | * listing screens. Default false. |
| 275 | * @type bool|callable $meta_box_cb Provide a callback function for the meta box display. If not set, |
| 276 | * post_categories_meta_box() is used for hierarchical taxonomies, and |
| 277 | * post_tags_meta_box() is used for non-hierarchical. If false, no meta |
| 278 | * box is shown. |
| 279 | * @type callable $meta_box_sanitize_cb Callback function for sanitizing taxonomy data saved from a meta |
| 280 | * box. If no callback is defined, an appropriate one is determined |
| 281 | * based on the value of `$meta_box_cb`. |
| 282 | * @type array $capabilities { |
| 283 | * Array of capabilities for this taxonomy. |
| 284 | * |
| 285 | * @type string $manage_terms Default 'manage_categories'. |
| 286 | * @type string $edit_terms Default 'manage_categories'. |
| 287 | * @type string $delete_terms Default 'manage_categories'. |
| 288 | * @type string $assign_terms Default 'edit_posts'. |
| 289 | * } |
| 290 | * @type bool|array $rewrite { |
| 291 | * Triggers the handling of rewrites for this taxonomy. Default true, using $taxonomy as slug. To prevent |
| 292 | * rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys: |
| 293 | * |
| 294 | * @type string $slug Customize the permastruct slug. Default `$taxonomy` key. |
| 295 | * @type bool $with_front Should the permastruct be prepended with WP_Rewrite::$front. Default true. |
| 296 | * @type bool $hierarchical Either hierarchical rewrite tag or not. Default false. |
| 297 | * @type int $ep_mask Assign an endpoint mask. Default `EP_NONE`. |
| 298 | * } |
| 299 | * @type string $query_var Sets the query var key for this taxonomy. Default `$taxonomy` key. * If false, a taxonomy cannot be loaded at `?{query_var}={term_slug} |
| 300 | * `. If a string, the query `?{query_var}={term_slug}` will be valid. |
| 301 | * @type callable $update_count_callback Works much like a hook, in that it will be called when the count is |
| 302 | * updated. Default _update_post_term_count() for taxonomies attached |
| 303 | * to post types, which confirms that the objects are published before |
| 304 | * counting them. Default _update_generic_term_count() for taxonomies |
| 305 | * attached to other object types, such as users. |
| 306 | * @type bool $_builtin This taxonomy is a "built-in" taxonomy. INTERNAL USE ONLY! |
| 307 | * Default false. |
| 308 | * } |