Schema filter
-
I want to add a custom field to the standard product name title, but preferably via filter instead of custom meta fields box. Of course I checked the faq, but couldn’t really tell if standard values can be changed using this filter:
add_filter('site-reviews/schema/Product', function ($schema) { global $product; $product_id = $product->get_id(); $product_name = $product->get_name(); $product_field = get_field('Inhoud', $product_id); $schema['product'] = [ '@type' => 'Product', 'name' => $product_name . '' . $product_field, ]; return $schema; });
But it’s not working, do I need to fill all the key / values in the array? Can you please confirm if this can be done? Or to use the metabox functions. Thank you as always.
- The topic ‘Schema filter’ is closed to new replies.