WC_Structured_Data::output_structured_data()publicWC 1.0

Sanitizes, encodes and outputs structured data.

Hooked into wp_footer hook. Hooked into woocommerce_email_order_details hook.

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

Хуков нет.

Возвращает

null. Ничего.

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

$WC_Structured_Data = new WC_Structured_Data();
$WC_Structured_Data->output_structured_data();

Код WC_Structured_Data::output_structured_data() WC 6.4.1

public function output_structured_data() {
	$types = $this->get_data_type_for_page();
	$data  = $this->get_structured_data( $types );

	if ( $data ) {
		echo '<script type="application/ld+json">' . wc_esc_json( wp_json_encode( $data ), true ) . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	}
}