WC_Admin_Taxonomies::create_term()publicWC 1.0

Order term when created (put in position 0).

Method of the class: WC_Admin_Taxonomies{}

No Hooks.

Return

null. Nothing (null).

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: ''

WC_Admin_Taxonomies::create_term() code WC 8.9.0

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

	update_term_meta( $term_id, 'order', 0 );
}