在创建分类法时,我正在尝试务实地添加分类法术语。我尝试添加
wp_insert_term(
'A00', // the term
'we_colors'
);
到tax_color_palletes
但这不是添加术语A00
。我正在处理这个片段;我怎样才能解决这个问题?
function tax_color_palletes() {
$labels = array(
'name' => 'Models',
'singular_name' => 'Model',
'menu_name' => 'Models',
'all_items' => 'All Models',
'parent_item' => 'Parent Model',
'parent_item_colon' => 'Parent Model',
'new_item_name' => 'Model Name',
'add_new_item' => 'Add New Model',
'edit_item' => 'Edit Model',
'update_item' => 'Update Model Type',
'separate_items_with_commas' => 'Separate Model with commas',
'search_items' => 'Search Models',
'add_or_remove_items' => 'Add or remove Model Type',
'choose_from_most_used' => 'Choose from the most used Model',
'not_found' => 'Model Not Found',
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
);
register_taxonomy( 'women_models', array( 'we_colors' ), $args );
wp_insert_term(
'A00', // the term
'we_colors'
);
}
add_action( 'init', 'tax_color_palletes', 0 );