In classes/woocommerce-schema.php we fetch data from the Meta_Tags_Context_Memoizer class, which caches the results of the first call for all the metadata. This happens under the assumption that all the metadata will be relative to a single page, which is not the case for the Schema aggregator because it iterates over different indexables.
We have two options:
- Add a method to the
Meta_Tags_Context_Memoizer that allows to swap the current page
- Use the
Meta_Tags_Context directly without passing through the memoizer: this requires more investigation and effort as it is going to impact classes other than Meta_Tags_Context_Memoizer.
Relevant Slack thread here.
In
classes/woocommerce-schema.phpwe fetch data from theMeta_Tags_Context_Memoizerclass, which caches the results of the first call for all the metadata. This happens under the assumption that all the metadata will be relative to a single page, which is not the case for the Schema aggregator because it iterates over different indexables.We have two options:
Meta_Tags_Context_Memoizerthat allows to swap the current pageMeta_Tags_Contextdirectly without passing through the memoizer: this requires more investigation and effort as it is going to impact classes other thanMeta_Tags_Context_Memoizer.Relevant Slack thread here.