Automattic\WooCommerce\Admin\Features\Navigation

Screen::is_woocommerce_core_taxonomy()public staticWC 1.0

Check if a given taxonomy is a WooCommerce core related taxonomy.

Метод класса: Screen{}

Хуков нет.

Возвращает

true|false.

Использование

$result = Screen::is_woocommerce_core_taxonomy( $taxonomy );
$taxonomy(строка) (обязательный)
Taxonomy.

Код Screen::is_woocommerce_core_taxonomy() WC 8.7.0

public static function is_woocommerce_core_taxonomy( $taxonomy ) {
	if ( in_array( $taxonomy, array( 'product_cat', 'product_tag' ), true ) ) {
		return true;
	}

	if ( 'pa_' === substr( $taxonomy, 0, 3 ) ) {
		return true;
	}

	return false;
}