/** * Replacement for the product FAQ FluentSnippet. * Keeps the existing questions_reponses meta and FAQPage JSON-LD output. */ add_filter( 'woocommerce_structured_data_product', function ( $markup, $product ) { if ( is_a( $product, 'WC_Product' ) ) { $markup['@id'] = get_permalink( $product->get_id() ) . '#product'; } return $markup; }, 10, 2 ); add_shortcode( 'faq_schema', 'fs_product_faq_schema_shortcode' ); if ( ! function_exists( 'fs_product_faq_schema_shortcode' ) ) { function fs_product_faq_schema_shortcode( $atts ) { if ( ! function_exists( 'is_product' ) || ! is_product() ) { return ''; } global $post; $items = get_post_meta( $post->ID, 'questions_reponses', true ); if ( empty( $items ) || ! is_array( $items ) ) { return '
Es gibt derzeit keine weiteren Kundenfragen.
'; } $css = ''; $js = ''; $schema = array( '@context' => 'https://schema.org', '@type' => 'FAQPage', 'mainEntity' => array(), ); $html = $css . 'Es gibt derzeit keine weiteren Kundenfragen.
'; } return $html . "\n"; } }