Edit File by line
/home/zeestwma/ceyloniy.../wp-inclu...
File: taxonomy.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Core Taxonomy API
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Taxonomy
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
//
[8] Fix | Delete
// Taxonomy registration.
[9] Fix | Delete
//
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Creates the initial taxonomies.
[13] Fix | Delete
*
[14] Fix | Delete
* This function fires twice: in wp-settings.php before plugins are loaded (for
[15] Fix | Delete
* backward compatibility reasons), and again on the {@see 'init'} action. We must
[16] Fix | Delete
* avoid registering rewrite rules before the {@see 'init'} action.
[17] Fix | Delete
*
[18] Fix | Delete
* @since 2.8.0
[19] Fix | Delete
* @since 5.9.0 Added `'wp_template_part_area'` taxonomy.
[20] Fix | Delete
*
[21] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[22] Fix | Delete
*/
[23] Fix | Delete
function create_initial_taxonomies() {
[24] Fix | Delete
global $wp_rewrite;
[25] Fix | Delete
[26] Fix | Delete
WP_Taxonomy::reset_default_labels();
[27] Fix | Delete
[28] Fix | Delete
if ( ! did_action( 'init' ) ) {
[29] Fix | Delete
$rewrite = array(
[30] Fix | Delete
'category' => false,
[31] Fix | Delete
'post_tag' => false,
[32] Fix | Delete
'post_format' => false,
[33] Fix | Delete
);
[34] Fix | Delete
} else {
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Filters the post formats rewrite base.
[38] Fix | Delete
*
[39] Fix | Delete
* @since 3.1.0
[40] Fix | Delete
*
[41] Fix | Delete
* @param string $context Context of the rewrite base. Default 'type'.
[42] Fix | Delete
*/
[43] Fix | Delete
$post_format_base = apply_filters( 'post_format_rewrite_base', 'type' );
[44] Fix | Delete
$rewrite = array(
[45] Fix | Delete
'category' => array(
[46] Fix | Delete
'hierarchical' => true,
[47] Fix | Delete
'slug' => get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category',
[48] Fix | Delete
'with_front' => ! get_option( 'category_base' ) || $wp_rewrite->using_index_permalinks(),
[49] Fix | Delete
'ep_mask' => EP_CATEGORIES,
[50] Fix | Delete
),
[51] Fix | Delete
'post_tag' => array(
[52] Fix | Delete
'hierarchical' => false,
[53] Fix | Delete
'slug' => get_option( 'tag_base' ) ? get_option( 'tag_base' ) : 'tag',
[54] Fix | Delete
'with_front' => ! get_option( 'tag_base' ) || $wp_rewrite->using_index_permalinks(),
[55] Fix | Delete
'ep_mask' => EP_TAGS,
[56] Fix | Delete
),
[57] Fix | Delete
'post_format' => $post_format_base ? array( 'slug' => $post_format_base ) : false,
[58] Fix | Delete
);
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
register_taxonomy(
[62] Fix | Delete
'category',
[63] Fix | Delete
'post',
[64] Fix | Delete
array(
[65] Fix | Delete
'hierarchical' => true,
[66] Fix | Delete
'query_var' => 'category_name',
[67] Fix | Delete
'rewrite' => $rewrite['category'],
[68] Fix | Delete
'public' => true,
[69] Fix | Delete
'show_ui' => true,
[70] Fix | Delete
'show_admin_column' => true,
[71] Fix | Delete
'_builtin' => true,
[72] Fix | Delete
'capabilities' => array(
[73] Fix | Delete
'manage_terms' => 'manage_categories',
[74] Fix | Delete
'edit_terms' => 'edit_categories',
[75] Fix | Delete
'delete_terms' => 'delete_categories',
[76] Fix | Delete
'assign_terms' => 'assign_categories',
[77] Fix | Delete
),
[78] Fix | Delete
'show_in_rest' => true,
[79] Fix | Delete
'rest_base' => 'categories',
[80] Fix | Delete
'rest_controller_class' => 'WP_REST_Terms_Controller',
[81] Fix | Delete
)
[82] Fix | Delete
);
[83] Fix | Delete
[84] Fix | Delete
register_taxonomy(
[85] Fix | Delete
'post_tag',
[86] Fix | Delete
'post',
[87] Fix | Delete
array(
[88] Fix | Delete
'hierarchical' => false,
[89] Fix | Delete
'query_var' => 'tag',
[90] Fix | Delete
'rewrite' => $rewrite['post_tag'],
[91] Fix | Delete
'public' => true,
[92] Fix | Delete
'show_ui' => true,
[93] Fix | Delete
'show_admin_column' => true,
[94] Fix | Delete
'_builtin' => true,
[95] Fix | Delete
'capabilities' => array(
[96] Fix | Delete
'manage_terms' => 'manage_post_tags',
[97] Fix | Delete
'edit_terms' => 'edit_post_tags',
[98] Fix | Delete
'delete_terms' => 'delete_post_tags',
[99] Fix | Delete
'assign_terms' => 'assign_post_tags',
[100] Fix | Delete
),
[101] Fix | Delete
'show_in_rest' => true,
[102] Fix | Delete
'rest_base' => 'tags',
[103] Fix | Delete
'rest_controller_class' => 'WP_REST_Terms_Controller',
[104] Fix | Delete
)
[105] Fix | Delete
);
[106] Fix | Delete
[107] Fix | Delete
register_taxonomy(
[108] Fix | Delete
'nav_menu',
[109] Fix | Delete
'nav_menu_item',
[110] Fix | Delete
array(
[111] Fix | Delete
'public' => false,
[112] Fix | Delete
'hierarchical' => false,
[113] Fix | Delete
'labels' => array(
[114] Fix | Delete
'name' => __( 'Navigation Menus' ),
[115] Fix | Delete
'singular_name' => __( 'Navigation Menu' ),
[116] Fix | Delete
),
[117] Fix | Delete
'query_var' => false,
[118] Fix | Delete
'rewrite' => false,
[119] Fix | Delete
'show_ui' => false,
[120] Fix | Delete
'_builtin' => true,
[121] Fix | Delete
'show_in_nav_menus' => false,
[122] Fix | Delete
'capabilities' => array(
[123] Fix | Delete
'manage_terms' => 'edit_theme_options',
[124] Fix | Delete
'edit_terms' => 'edit_theme_options',
[125] Fix | Delete
'delete_terms' => 'edit_theme_options',
[126] Fix | Delete
'assign_terms' => 'edit_theme_options',
[127] Fix | Delete
),
[128] Fix | Delete
'show_in_rest' => true,
[129] Fix | Delete
'rest_base' => 'menus',
[130] Fix | Delete
'rest_controller_class' => 'WP_REST_Menus_Controller',
[131] Fix | Delete
)
[132] Fix | Delete
);
[133] Fix | Delete
[134] Fix | Delete
register_taxonomy(
[135] Fix | Delete
'link_category',
[136] Fix | Delete
'link',
[137] Fix | Delete
array(
[138] Fix | Delete
'hierarchical' => false,
[139] Fix | Delete
'labels' => array(
[140] Fix | Delete
'name' => __( 'Link Categories' ),
[141] Fix | Delete
'singular_name' => __( 'Link Category' ),
[142] Fix | Delete
'search_items' => __( 'Search Link Categories' ),
[143] Fix | Delete
'popular_items' => null,
[144] Fix | Delete
'all_items' => __( 'All Link Categories' ),
[145] Fix | Delete
'edit_item' => __( 'Edit Link Category' ),
[146] Fix | Delete
'update_item' => __( 'Update Link Category' ),
[147] Fix | Delete
'add_new_item' => __( 'Add Link Category' ),
[148] Fix | Delete
'new_item_name' => __( 'New Link Category Name' ),
[149] Fix | Delete
'separate_items_with_commas' => null,
[150] Fix | Delete
'add_or_remove_items' => null,
[151] Fix | Delete
'choose_from_most_used' => null,
[152] Fix | Delete
'back_to_items' => __( '&larr; Go to Link Categories' ),
[153] Fix | Delete
),
[154] Fix | Delete
'capabilities' => array(
[155] Fix | Delete
'manage_terms' => 'manage_links',
[156] Fix | Delete
'edit_terms' => 'manage_links',
[157] Fix | Delete
'delete_terms' => 'manage_links',
[158] Fix | Delete
'assign_terms' => 'manage_links',
[159] Fix | Delete
),
[160] Fix | Delete
'query_var' => false,
[161] Fix | Delete
'rewrite' => false,
[162] Fix | Delete
'public' => false,
[163] Fix | Delete
'show_ui' => true,
[164] Fix | Delete
'_builtin' => true,
[165] Fix | Delete
)
[166] Fix | Delete
);
[167] Fix | Delete
[168] Fix | Delete
register_taxonomy(
[169] Fix | Delete
'post_format',
[170] Fix | Delete
'post',
[171] Fix | Delete
array(
[172] Fix | Delete
'public' => true,
[173] Fix | Delete
'hierarchical' => false,
[174] Fix | Delete
'labels' => array(
[175] Fix | Delete
'name' => _x( 'Formats', 'post format' ),
[176] Fix | Delete
'singular_name' => _x( 'Format', 'post format' ),
[177] Fix | Delete
),
[178] Fix | Delete
'query_var' => true,
[179] Fix | Delete
'rewrite' => $rewrite['post_format'],
[180] Fix | Delete
'show_ui' => false,
[181] Fix | Delete
'_builtin' => true,
[182] Fix | Delete
'show_in_nav_menus' => current_theme_supports( 'post-formats' ),
[183] Fix | Delete
)
[184] Fix | Delete
);
[185] Fix | Delete
[186] Fix | Delete
register_taxonomy(
[187] Fix | Delete
'wp_theme',
[188] Fix | Delete
array( 'wp_template', 'wp_template_part', 'wp_global_styles' ),
[189] Fix | Delete
array(
[190] Fix | Delete
'public' => false,
[191] Fix | Delete
'hierarchical' => false,
[192] Fix | Delete
'labels' => array(
[193] Fix | Delete
'name' => __( 'Themes' ),
[194] Fix | Delete
'singular_name' => __( 'Theme' ),
[195] Fix | Delete
),
[196] Fix | Delete
'query_var' => false,
[197] Fix | Delete
'rewrite' => false,
[198] Fix | Delete
'show_ui' => false,
[199] Fix | Delete
'_builtin' => true,
[200] Fix | Delete
'show_in_nav_menus' => false,
[201] Fix | Delete
'show_in_rest' => false,
[202] Fix | Delete
)
[203] Fix | Delete
);
[204] Fix | Delete
[205] Fix | Delete
register_taxonomy(
[206] Fix | Delete
'wp_template_part_area',
[207] Fix | Delete
array( 'wp_template_part' ),
[208] Fix | Delete
array(
[209] Fix | Delete
'public' => false,
[210] Fix | Delete
'hierarchical' => false,
[211] Fix | Delete
'labels' => array(
[212] Fix | Delete
'name' => __( 'Template Part Areas' ),
[213] Fix | Delete
'singular_name' => __( 'Template Part Area' ),
[214] Fix | Delete
),
[215] Fix | Delete
'query_var' => false,
[216] Fix | Delete
'rewrite' => false,
[217] Fix | Delete
'show_ui' => false,
[218] Fix | Delete
'_builtin' => true,
[219] Fix | Delete
'show_in_nav_menus' => false,
[220] Fix | Delete
'show_in_rest' => false,
[221] Fix | Delete
)
[222] Fix | Delete
);
[223] Fix | Delete
[224] Fix | Delete
register_taxonomy(
[225] Fix | Delete
'wp_pattern_category',
[226] Fix | Delete
array( 'wp_block' ),
[227] Fix | Delete
array(
[228] Fix | Delete
'public' => false,
[229] Fix | Delete
'publicly_queryable' => false,
[230] Fix | Delete
'hierarchical' => false,
[231] Fix | Delete
'labels' => array(
[232] Fix | Delete
'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
[233] Fix | Delete
'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
[234] Fix | Delete
'add_new_item' => __( 'Add Category' ),
[235] Fix | Delete
'add_or_remove_items' => __( 'Add or remove pattern categories' ),
[236] Fix | Delete
'back_to_items' => __( '&larr; Go to Pattern Categories' ),
[237] Fix | Delete
'choose_from_most_used' => __( 'Choose from the most used pattern categories' ),
[238] Fix | Delete
'edit_item' => __( 'Edit Pattern Category' ),
[239] Fix | Delete
'item_link' => __( 'Pattern Category Link' ),
[240] Fix | Delete
'item_link_description' => __( 'A link to a pattern category.' ),
[241] Fix | Delete
'items_list' => __( 'Pattern Categories list' ),
[242] Fix | Delete
'items_list_navigation' => __( 'Pattern Categories list navigation' ),
[243] Fix | Delete
'new_item_name' => __( 'New Pattern Category Name' ),
[244] Fix | Delete
'no_terms' => __( 'No pattern categories' ),
[245] Fix | Delete
'not_found' => __( 'No pattern categories found.' ),
[246] Fix | Delete
'popular_items' => __( 'Popular Pattern Categories' ),
[247] Fix | Delete
'search_items' => __( 'Search Pattern Categories' ),
[248] Fix | Delete
'separate_items_with_commas' => __( 'Separate pattern categories with commas' ),
[249] Fix | Delete
'update_item' => __( 'Update Pattern Category' ),
[250] Fix | Delete
'view_item' => __( 'View Pattern Category' ),
[251] Fix | Delete
),
[252] Fix | Delete
'query_var' => false,
[253] Fix | Delete
'rewrite' => false,
[254] Fix | Delete
'show_ui' => true,
[255] Fix | Delete
'_builtin' => true,
[256] Fix | Delete
'show_in_nav_menus' => false,
[257] Fix | Delete
'show_in_rest' => true,
[258] Fix | Delete
'show_admin_column' => true,
[259] Fix | Delete
'show_tagcloud' => false,
[260] Fix | Delete
)
[261] Fix | Delete
);
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
/**
[265] Fix | Delete
* Retrieves a list of registered taxonomy names or objects.
[266] Fix | Delete
*
[267] Fix | Delete
* @since 3.0.0
[268] Fix | Delete
*
[269] Fix | Delete
* @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
[270] Fix | Delete
*
[271] Fix | Delete
* @param array $args Optional. An array of `key => value` arguments to match against the taxonomy objects.
[272] Fix | Delete
* Default empty array.
[273] Fix | Delete
* @param string $output Optional. The type of output to return in the array. Either 'names'
[274] Fix | Delete
* or 'objects'. Default 'names'.
[275] Fix | Delete
* @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
[276] Fix | Delete
* one element from the array needs to match; 'and' means all elements must match.
[277] Fix | Delete
* Default 'and'.
[278] Fix | Delete
* @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
[279] Fix | Delete
*/
[280] Fix | Delete
function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) {
[281] Fix | Delete
global $wp_taxonomies;
[282] Fix | Delete
[283] Fix | Delete
$field = ( 'names' === $output ) ? 'name' : false;
[284] Fix | Delete
[285] Fix | Delete
return wp_filter_object_list( $wp_taxonomies, $args, $operator, $field );
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
/**
[289] Fix | Delete
* Returns the names or objects of the taxonomies which are registered for the requested object or object type,
[290] Fix | Delete
* such as a post object or post type name.
[291] Fix | Delete
*
[292] Fix | Delete
* Example:
[293] Fix | Delete
*
[294] Fix | Delete
* $taxonomies = get_object_taxonomies( 'post' );
[295] Fix | Delete
*
[296] Fix | Delete
* This results in:
[297] Fix | Delete
*
[298] Fix | Delete
* Array( 'category', 'post_tag' )
[299] Fix | Delete
*
[300] Fix | Delete
* @since 2.3.0
[301] Fix | Delete
*
[302] Fix | Delete
* @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
[303] Fix | Delete
*
[304] Fix | Delete
* @param string|string[]|WP_Post $object_type Name of the type of taxonomy object, or an object (row from posts).
[305] Fix | Delete
* @param string $output Optional. The type of output to return in the array. Accepts either
[306] Fix | Delete
* 'names' or 'objects'. Default 'names'.
[307] Fix | Delete
* @return string[]|WP_Taxonomy[] The names or objects of all taxonomies of `$object_type`.
[308] Fix | Delete
*/
[309] Fix | Delete
function get_object_taxonomies( $object_type, $output = 'names' ) {
[310] Fix | Delete
global $wp_taxonomies;
[311] Fix | Delete
[312] Fix | Delete
if ( is_object( $object_type ) ) {
[313] Fix | Delete
if ( 'attachment' === $object_type->post_type ) {
[314] Fix | Delete
return get_attachment_taxonomies( $object_type, $output );
[315] Fix | Delete
}
[316] Fix | Delete
$object_type = $object_type->post_type;
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
$object_type = (array) $object_type;
[320] Fix | Delete
[321] Fix | Delete
$taxonomies = array();
[322] Fix | Delete
foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {
[323] Fix | Delete
if ( array_intersect( $object_type, (array) $tax_obj->object_type ) ) {
[324] Fix | Delete
if ( 'names' === $output ) {
[325] Fix | Delete
$taxonomies[] = $tax_name;
[326] Fix | Delete
} else {
[327] Fix | Delete
$taxonomies[ $tax_name ] = $tax_obj;
[328] Fix | Delete
}
[329] Fix | Delete
}
[330] Fix | Delete
}
[331] Fix | Delete
[332] Fix | Delete
return $taxonomies;
[333] Fix | Delete
}
[334] Fix | Delete
[335] Fix | Delete
/**
[336] Fix | Delete
* Retrieves the taxonomy object of $taxonomy.
[337] Fix | Delete
*
[338] Fix | Delete
* The get_taxonomy function will first check that the parameter string given
[339] Fix | Delete
* is a taxonomy object and if it is, it will return it.
[340] Fix | Delete
*
[341] Fix | Delete
* @since 2.3.0
[342] Fix | Delete
*
[343] Fix | Delete
* @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
[344] Fix | Delete
*
[345] Fix | Delete
* @param string $taxonomy Name of taxonomy object to return.
[346] Fix | Delete
* @return WP_Taxonomy|false The taxonomy object or false if $taxonomy doesn't exist.
[347] Fix | Delete
*/
[348] Fix | Delete
function get_taxonomy( $taxonomy ) {
[349] Fix | Delete
global $wp_taxonomies;
[350] Fix | Delete
[351] Fix | Delete
if ( ! taxonomy_exists( $taxonomy ) ) {
[352] Fix | Delete
return false;
[353] Fix | Delete
}
[354] Fix | Delete
[355] Fix | Delete
return $wp_taxonomies[ $taxonomy ];
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
/**
[359] Fix | Delete
* Determines whether the taxonomy name exists.
[360] Fix | Delete
*
[361] Fix | Delete
* Formerly is_taxonomy(), introduced in 2.3.0.
[362] Fix | Delete
*
[363] Fix | Delete
* For more information on this and similar theme functions, check out
[364] Fix | Delete
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
[365] Fix | Delete
* Conditional Tags} article in the Theme Developer Handbook.
[366] Fix | Delete
*
[367] Fix | Delete
* @since 3.0.0
[368] Fix | Delete
*
[369] Fix | Delete
* @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
[370] Fix | Delete
*
[371] Fix | Delete
* @param string $taxonomy Name of taxonomy object.
[372] Fix | Delete
* @return bool Whether the taxonomy exists.
[373] Fix | Delete
*/
[374] Fix | Delete
function taxonomy_exists( $taxonomy ) {
[375] Fix | Delete
global $wp_taxonomies;
[376] Fix | Delete
[377] Fix | Delete
return is_string( $taxonomy ) && isset( $wp_taxonomies[ $taxonomy ] );
[378] Fix | Delete
}
[379] Fix | Delete
[380] Fix | Delete
/**
[381] Fix | Delete
* Determines whether the taxonomy object is hierarchical.
[382] Fix | Delete
*
[383] Fix | Delete
* Checks to make sure that the taxonomy is an object first. Then Gets the
[384] Fix | Delete
* object, and finally returns the hierarchical value in the object.
[385] Fix | Delete
*
[386] Fix | Delete
* A false return value might also mean that the taxonomy does not exist.
[387] Fix | Delete
*
[388] Fix | Delete
* For more information on this and similar theme functions, check out
[389] Fix | Delete
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
[390] Fix | Delete
* Conditional Tags} article in the Theme Developer Handbook.
[391] Fix | Delete
*
[392] Fix | Delete
* @since 2.3.0
[393] Fix | Delete
*
[394] Fix | Delete
* @param string $taxonomy Name of taxonomy object.
[395] Fix | Delete
* @return bool Whether the taxonomy is hierarchical.
[396] Fix | Delete
*/
[397] Fix | Delete
function is_taxonomy_hierarchical( $taxonomy ) {
[398] Fix | Delete
if ( ! taxonomy_exists( $taxonomy ) ) {
[399] Fix | Delete
return false;
[400] Fix | Delete
}
[401] Fix | Delete
[402] Fix | Delete
$taxonomy = get_taxonomy( $taxonomy );
[403] Fix | Delete
return $taxonomy->hierarchical;
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
/**
[407] Fix | Delete
* Creates or modifies a taxonomy object.
[408] Fix | Delete
*
[409] Fix | Delete
* Note: Do not use before the {@see 'init'} hook.
[410] Fix | Delete
*
[411] Fix | Delete
* A simple function for creating or modifying a taxonomy object based on
[412] Fix | Delete
* the parameters given. If modifying an existing taxonomy object, note
[413] Fix | Delete
* that the `$object_type` value from the original registration will be
[414] Fix | Delete
* overwritten.
[415] Fix | Delete
*
[416] Fix | Delete
* @since 2.3.0
[417] Fix | Delete
* @since 4.2.0 Introduced `show_in_quick_edit` argument.
[418] Fix | Delete
* @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.
[419] Fix | Delete
* @since 4.4.0 The `public` argument now controls whether the taxonomy can be queried on the front end.
[420] Fix | Delete
* @since 4.5.0 Introduced `publicly_queryable` argument.
[421] Fix | Delete
* @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'
[422] Fix | Delete
* arguments to register the taxonomy in REST API.
[423] Fix | Delete
* @since 5.1.0 Introduced `meta_box_sanitize_cb` argument.
[424] Fix | Delete
* @since 5.4.0 Added the registered taxonomy object as a return value.
[425] Fix | Delete
* @since 5.5.0 Introduced `default_term` argument.
[426] Fix | Delete
* @since 5.9.0 Introduced `rest_namespace` argument.
[427] Fix | Delete
*
[428] Fix | Delete
* @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies.
[429] Fix | Delete
*
[430] Fix | Delete
* @param string $taxonomy Taxonomy key. Must not exceed 32 characters and may only contain
[431] Fix | Delete
* lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().
[432] Fix | Delete
* @param array|string $object_type Object type or array of object types with which the taxonomy should be associated.
[433] Fix | Delete
* @param array|string $args {
[434] Fix | Delete
* Optional. Array or query string of arguments for registering a taxonomy.
[435] Fix | Delete
*
[436] Fix | Delete
* @type string[] $labels An array of labels for this taxonomy. By default, Tag labels are
[437] Fix | Delete
* used for non-hierarchical taxonomies, and Category labels are used
[438] Fix | Delete
* for hierarchical taxonomies. See accepted values in
[439] Fix | Delete
* get_taxonomy_labels(). Default empty array.
[440] Fix | Delete
* @type string $description A short descriptive summary of what the taxonomy is for. Default empty.
[441] Fix | Delete
* @type bool $public Whether a taxonomy is intended for use publicly either via
[442] Fix | Delete
* the admin interface or by front-end users. The default settings
[443] Fix | Delete
* of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus`
[444] Fix | Delete
* are inherited from `$public`.
[445] Fix | Delete
* @type bool $publicly_queryable Whether the taxonomy is publicly queryable.
[446] Fix | Delete
* If not set, the default is inherited from `$public`
[447] Fix | Delete
* @type bool $hierarchical Whether the taxonomy is hierarchical. Default false.
[448] Fix | Delete
* @type bool $show_ui Whether to generate and allow a UI for managing terms in this taxonomy in
[449] Fix | Delete
* the admin. If not set, the default is inherited from `$public`
[450] Fix | Delete
* (default true).
[451] Fix | Delete
* @type bool $show_in_menu Whether to show the taxonomy in the admin menu. If true, the taxonomy is
[452] Fix | Delete
* shown as a submenu of the object type menu. If false, no menu is shown.
[453] Fix | Delete
* `$show_ui` must be true. If not set, default is inherited from `$show_ui`
[454] Fix | Delete
* (default true).
[455] Fix | Delete
* @type bool $show_in_nav_menus Makes this taxonomy available for selection in navigation menus. If not
[456] Fix | Delete
* set, the default is inherited from `$public` (default true).
[457] Fix | Delete
* @type bool $show_in_rest Whether to include the taxonomy in the REST API. Set this to true
[458] Fix | Delete
* for the taxonomy to be available in the block editor.
[459] Fix | Delete
* @type string $rest_base To change the base url of REST API route. Default is $taxonomy.
[460] Fix | Delete
* @type string $rest_namespace To change the namespace URL of REST API route. Default is wp/v2.
[461] Fix | Delete
* @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Terms_Controller'.
[462] Fix | Delete
* @type bool $show_tagcloud Whether to list the taxonomy in the Tag Cloud Widget controls. If not set,
[463] Fix | Delete
* the default is inherited from `$show_ui` (default true).
[464] Fix | Delete
* @type bool $show_in_quick_edit Whether to show the taxonomy in the quick/bulk edit panel. It not set,
[465] Fix | Delete
* the default is inherited from `$show_ui` (default true).
[466] Fix | Delete
* @type bool $show_admin_column Whether to display a column for the taxonomy on its post type listing
[467] Fix | Delete
* screens. Default false.
[468] Fix | Delete
* @type bool|callable $meta_box_cb Provide a callback function for the meta box display. If not set,
[469] Fix | Delete
* post_categories_meta_box() is used for hierarchical taxonomies, and
[470] Fix | Delete
* post_tags_meta_box() is used for non-hierarchical. If false, no meta
[471] Fix | Delete
* box is shown.
[472] Fix | Delete
* @type callable $meta_box_sanitize_cb Callback function for sanitizing taxonomy data saved from a meta
[473] Fix | Delete
* box. If no callback is defined, an appropriate one is determined
[474] Fix | Delete
* based on the value of `$meta_box_cb`.
[475] Fix | Delete
* @type string[] $capabilities {
[476] Fix | Delete
* Array of capabilities for this taxonomy.
[477] Fix | Delete
*
[478] Fix | Delete
* @type string $manage_terms Default 'manage_categories'.
[479] Fix | Delete
* @type string $edit_terms Default 'manage_categories'.
[480] Fix | Delete
* @type string $delete_terms Default 'manage_categories'.
[481] Fix | Delete
* @type string $assign_terms Default 'edit_posts'.
[482] Fix | Delete
* }
[483] Fix | Delete
* @type bool|array $rewrite {
[484] Fix | Delete
* Triggers the handling of rewrites for this taxonomy. Default true, using $taxonomy as slug. To prevent
[485] Fix | Delete
* rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys:
[486] Fix | Delete
*
[487] Fix | Delete
* @type string $slug Customize the permastruct slug. Default `$taxonomy` key.
[488] Fix | Delete
* @type bool $with_front Should the permastruct be prepended with WP_Rewrite::$front. Default true.
[489] Fix | Delete
* @type bool $hierarchical Either hierarchical rewrite tag or not. Default false.
[490] Fix | Delete
* @type int $ep_mask Assign an endpoint mask. Default `EP_NONE`.
[491] Fix | Delete
* }
[492] Fix | Delete
* @type string|bool $query_var Sets the query var key for this taxonomy. Default `$taxonomy` key. If
[493] Fix | Delete
* false, a taxonomy cannot be loaded at `?{query_var}={term_slug}`. If a
[494] Fix | Delete
* string, the query `?{query_var}={term_slug}` will be valid.
[495] Fix | Delete
* @type callable $update_count_callback Works much like a hook, in that it will be called when the count is
[496] Fix | Delete
* updated. Default _update_post_term_count() for taxonomies attached
[497] Fix | Delete
* to post types, which confirms that the objects are published before
[498] Fix | Delete
* counting them. Default _update_generic_term_count() for taxonomies
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function