WC_Structured_Data::get_data_type_for_page()protectedWC 1.0

Get data types for pages.

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

Хуки из метода

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_data_type_for_page();

Код WC_Structured_Data::get_data_type_for_page() WC 8.7.0

protected function get_data_type_for_page() {
	$types   = array();
	$types[] = is_shop() || is_product_category() || is_product() ? 'product' : '';
	$types[] = is_shop() && is_front_page() ? 'website' : '';
	$types[] = is_product() ? 'review' : '';
	$types[] = 'breadcrumblist';
	$types[] = 'order';

	return array_filter( apply_filters( 'woocommerce_structured_data_type_for_page', $types ) );
}