WC_Structured_Data::output_structured_data
Sanitizes, encodes and outputs structured data.
Hooked into wp_footer hook. Hooked into woocommerce_email_order_details hook.
Метод класса: WC_Structured_Data{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Structured_Data = new WC_Structured_Data(); $WC_Structured_Data->output_structured_data();
Код WC_Structured_Data::output_structured_data() WC Structured Data::output structured data WC 11.3.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, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), true ) . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}