States Taxonomy
if ( ! function_exists( 'States' ) ) {
// Register Custom Taxonomy
function States() {
$labels = array(
'name' => _x( 'States', 'Taxonomy General Name', 'ad-state' ),
'singular_name' => _x( 'State', 'Taxonomy Singular Name', 'ad-state' ),
'menu_name' => __( 'State', 'ad-state' ),
'all_items' => __( 'All States', 'ad-state' ),
'parent_item' => __( 'Parent Item', 'ad-state' ),
'parent_item_colon' => __( 'Parent Item:', 'ad-state' ),
'new_item_name' => __( 'New Item State', 'ad-state' ),
'add_new_item' => __( 'Add New State', 'ad-state' ),
'edit_item' => __( 'Edit Item', 'ad-state' ),
'update_item' => __( 'Update Item', 'ad-state' ),
'view_item' => __( 'View Item', 'ad-state' ),
'separate_items_with_commas' => __( 'Separate State with commas', 'ad-state' ),
'add_or_remove_items' => __( 'Add or remove State', 'ad-state' ),
'choose_from_most_used' => __( 'Choose from the most used', 'ad-state' ),
'popular_items' => __( 'Popular Items', 'ad-state' ),
'search_items' => __( 'Search Items', 'ad-state' ),
'not_found' => __( 'Not Found', 'ad-state' ),
'no_terms' => __( 'No items', 'ad-state' ),
'items_list' => __( 'Items list', 'ad-state' ),
'items_list_navigation' => __( 'Items list navigation', 'ad-state' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'update_count_callback' => 'sink_ad_state_updated',
'show_in_rest' => false,
);
register_taxonomy( 'ad_states', array( 'ad' ), $args );
}
add_action( 'init', 'States', 0 );
}