WC_Structured_Data::get_data_type_for_page()protectedWC 1.0

Get data types for pages.

Method of the class: WC_Structured_Data{}

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_data_type_for_page();

WC_Structured_Data::get_data_type_for_page() code 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 ) );
}