WC_Admin_Taxonomies::create_term()publicWC 1.0

Order term when created (put in position 0).

{} It's a method of the class: WC_Admin_Taxonomies{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Taxonomies = new WC_Admin_Taxonomies();
$WC_Admin_Taxonomies->create_term( $term_id, $tt_id, $taxonomy );
$term_id(mixed) (required)
Term ID.
$tt_id(mixed)
Term taxonomy ID.
Default: ''
$taxonomy(string)
Taxonomy slug.
Default: ''

Code of WC_Admin_Taxonomies::create_term() WC 6.7.0

public function create_term( $term_id, $tt_id = '', $taxonomy = '' ) {
	if ( 'product_cat' !== $taxonomy && ! taxonomy_is_product_attribute( $taxonomy ) ) {
		return;
	}

	$meta_name = taxonomy_is_product_attribute( $taxonomy ) ? 'order_' . esc_attr( $taxonomy ) : 'order';

	update_term_meta( $term_id, $meta_name, 0 );
}