WordPress at Your Fingertips
function is not described

WC_Structured_Data::output_structured_data() public WC 1.0

Sanitizes, encodes and outputs structured data.

Hooked into wp_footer hook. Hooked into woocommerce_email_order_details hook.

{} It's a method of the class: WC_Structured_Data{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of WC_Structured_Data::output_structured_data() WC 5.6.0

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
	}
}