WC_Admin_Taxonomies::__construct()publicWC 1.0

Constructor.

Method of the class: WC_Admin_Taxonomies{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Taxonomies = new WC_Admin_Taxonomies();
$WC_Admin_Taxonomies->__construct();

WC_Admin_Taxonomies::__construct() code WC 9.4.2

public function __construct() {
	// Default category ID.
	$this->default_cat_id = get_option( 'default_product_cat', 0 );

	// Category/term ordering.
	add_action( 'create_term', array( $this, 'create_term' ), 5, 3 );
	add_action(
		'delete_product_cat',
		function() {
			wc_get_container()->get( AssignDefaultCategory::class )->schedule_action();
		}
	);

	// Add form.
	add_action( 'product_cat_add_form_fields', array( $this, 'add_category_fields' ) );
	add_action( 'product_cat_edit_form_fields', array( $this, 'edit_category_fields' ), 10 );
	add_action( 'created_term', array( $this, 'save_category_fields' ), 10, 3 );
	add_action( 'edit_term', array( $this, 'save_category_fields' ), 10, 3 );

	// Add columns.
	add_filter( 'manage_edit-product_cat_columns', array( $this, 'product_cat_columns' ) );
	add_filter( 'manage_product_cat_custom_column', array( $this, 'product_cat_column' ), 10, 3 );

	// Add row actions.
	add_filter( 'product_cat_row_actions', array( $this, 'product_cat_row_actions' ), 10, 2 );
	add_filter( 'admin_init', array( $this, 'handle_product_cat_row_actions' ) );

	// Taxonomy page descriptions.
	add_action( 'product_cat_pre_add_form', array( $this, 'product_cat_description' ) );
	add_action( 'after-product_cat-table', array( $this, 'product_cat_notes' ) );

	$attribute_taxonomies = wc_get_attribute_taxonomies();

	if ( ! empty( $attribute_taxonomies ) ) {
		foreach ( $attribute_taxonomies as $attribute ) {
			add_action( 'pa_' . $attribute->attribute_name . '_pre_add_form', array( $this, 'product_attribute_description' ) );
		}
	}

	// Maintain hierarchy of terms.
	add_filter( 'wp_terms_checklist_args', array( $this, 'disable_checked_ontop' ) );

	// Admin footer scripts for this product categories admin screen.
	add_action( 'admin_footer', array( $this, 'scripts_at_product_cat_screen_footer' ) );
}