Add WooCommerce integration and extensibility filters#37
Draft
Add WooCommerce integration and extensibility filters#37
Conversation
Exposes WooCommerce products at .md URLs with price, SKU, stock, attributes, and variations. Introduces two filters (markdown_alternate_frontmatter, markdown_alternate_content_sections) plus a cache_version filter so any plugin can extend the markdown output without subclassing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
get_price_html() injects screen-reader spans and NBSP entities that look garbled in markdown. Build the price from raw values via wc_price() instead, and decode entities/NBSP for clean output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.mdURLs with price, SKU, stock status, attributes, and variations — fixes WooCommerce Product Pages #32.markdown_alternate_frontmatterandmarkdown_alternate_content_sectionsfilters so any plugin can extend the markdown output without subclassing. The WooCommerce integration is the reference implementation.markdown_alternate_cache_versionfilter and mixes it into the transient cache key, so integrations pulling from postmeta can invalidate cleanly. Woo also invalidates onwoocommerce_update_productand stock-change hooks.Design notes
ContentRenderer::generate_frontmatter()now builds an associative data array and passes it through a YAML serializer, so integrations add keys instead of string-munging YAML.class_exists('WooCommerce')inPlugin::register_integrations().Test plan
/product/sample.mdreturns a product page with price/SKU/stock in frontmatter and a summary block in the body## Variationssection listing each variation with attributes + price## Attributesheading.mdoutputcook_timefrontmatter key and an "Ingredients" section renders correctly