Skip to content

Member Content: Gate WooCommerce Information in Store API and Blocks - #1257

Draft
n7studios wants to merge 4 commits into
member-content-restrict-archivesfrom
member-content-restrict-woocommerce
Draft

n7studios wants to merge 4 commits into
member-content-restrict-archivesfrom
member-content-restrict-woocommerce

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Restricts WooCommerce Product descriptions outside of the Product's page, such as the Store API (/wc/store/v1/products) and Product blocks.

Previously the Store API, and Store API data embedded in pages by WooCommerce's blocks (e.g. related Products), included the full description and short description of restricted Products.

For visitors who can't access a restricted Product:

  • woocommerce_product_get_description: replaced with the content preview, matching the Product's page. Variation descriptions are hidden.
  • woocommerce_product_get_short_description: hidden, matching the Product's page.

Users who can edit the Product, and subscribers with access, still see the full description.

Testing

WooCommerceRestrictContentCest::testRestrictContentInStoreAPI: Store API returns the content preview and no short description to visitors, and the full content to subscribers with access.

Checklist

@n7studios n7studios added this to the 3.4.8 milestone Oct 23, 2026
@n7studios n7studios self-assigned this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant