How do you pass data from PHP to the store?
wp_interactivity_state( 'namespace', [...] ) — global state; wp_interactivity_data_wp_context() — the local context of a specific block.
questions
wp_interactivity_state( 'namespace', [...] ) — global state; wp_interactivity_data_wp_context() — the local context of a specific block.
A way to pass data from a parent block to its children: providesContext on the parent, usesContext on the child. Product Template passes the postId of every product.
A WooCommerce block for product lists with ready-made collections (new arrivals, on sale, best sellers, related products) and filters. The inner Product Template defines the product card from separate blocks.
The WordPress standard for frontend interactivity: the server renders HTML with data-wp-* directives, and a small runtime binds them to a JS store. Blocks on the same page can share state.
When the data changes independently of content editing: prices, stock, user data, post lists. Then render.php generates the HTML on every request.
In the database as a post of type wp_template. They take priority over the theme file until they are reset.
It adds the classes and styles from supports (colors, spacing, alignment) to the block wrapper. Without it the inspector settings don't reach the markup.
Store templates are edited without code, styles are centralized in theme.json, and block cart and checkout work by default. The price is a compatibility audit of plugins that depend on PHP templates.
No duplicated markup on the client, it works with server rendering, and the scripts are modules loaded only with the block. State can be passed from PHP through wp_interactivity_state().
No questions found. Try another search.