WC_Admin_Taxonomies::create_term( mixed $term_id, mixed $tt_id = '', string $taxonomy = '' )

Order term when created (put in position 0).


Description Description


Parameters Parameters

$term_id

(Required) Term ID.

$tt_id

(Optional) Term taxonomy ID.

Default value: ''

$taxonomy

(Optional) Taxonomy slug.

Default value: ''


Top ↑

Source Source

File: includes/admin/class-wc-admin-taxonomies.php

101
102
103
104
105
106
107
108
109
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 );
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.