fix: run do_shortcode on manual, custom placements for the block theme#1526
fix: run do_shortcode on manual, custom placements for the block theme#1526laurelfulford merged 4 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses prompt blocks not rendering when inserted into block-theme templates/template parts by changing how the underlying [newspack-popup] shortcode is executed in dynamic block render callbacks.
Changes:
- Detect block themes and render the prompt via
do_shortcode()instead of returning awp:shortcodeblock comment wrapper. - Apply the same logic to both the Single Prompt block and the Custom Placement block renderers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/blocks/single-prompt/view.php | Adds block-theme detection and renders the prompt shortcode directly for block themes. |
| src/blocks/custom-placement/view.php | Mirrors the block-theme shortcode rendering change for custom placement prompts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
miguelpeixe
left a comment
There was a problem hiding this comment.
Good solution and tests well!
|
Yay! Thanks @miguelpeixe! 🙌 😄 |
|
Hey @laurelfulford, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# [3.10.0-alpha.1](v3.9.2...v3.10.0-alpha.1) (2026-03-05) ### Bug Fixes * add is-layout-constrained and is-layout-flow CSS classes for block themes ([#1521](#1521)) ([bafa61f](bafa61f)) * give more specific overlays priority by tweaking DOM order ([f0a64ef](f0a64ef)) * give more specific overlays priority by tweaking DOM order ([b8abd19](b8abd19)) * iframe editor compatibility ([#1520](#1520)) ([222f33c](222f33c)) * leave inline (non-overlay) popups in default non-sort ([a9c6f64](a9c6f64)) * run do_shortcode on manual, custom placements for the block theme ([#1526](#1526)) ([adbca1c](adbca1c)) ### Features * add AI agent guidelines ([#1530](#1530)) ([d0c4eb4](d0c4eb4))
|
🎉 This PR is included in version 3.10.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [3.10.0](v3.9.2...v3.10.0) (2026-03-16) ### Bug Fixes * add is-layout-constrained and is-layout-flow CSS classes for block themes ([#1521](#1521)) ([bafa61f](bafa61f)) * give more specific overlays priority by tweaking DOM order ([f0a64ef](f0a64ef)) * give more specific overlays priority by tweaking DOM order ([b8abd19](b8abd19)) * iframe editor compatibility ([#1520](#1520)) ([222f33c](222f33c)) * leave inline (non-overlay) popups in default non-sort ([a9c6f64](a9c6f64)) * run do_shortcode on manual, custom placements for the block theme ([#1526](#1526)) ([adbca1c](adbca1c)) ### Features * add AI agent guidelines ([#1530](#1530)) ([d0c4eb4](d0c4eb4))
|
🎉 This PR is included in version 3.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
While Single Prompt and Custom Placements still work in the post/page content using the block theme, it absolutely does not want to do anything with the shortcode these placements use when placed in a template/template part via the site editor.
This PR adds a check for the block theme and the content, and runs
do_shortcode()when you're using the block theme and not in the content, rather than inserting the shortcode block code directly. Both Copilot and Cursor suggested using a filter to make it easier to swap between these two "themes" for testing, so I went with that, too 😅I think this is kind of a temporary measure; NPPD-1216 proposes some changes to campaigns to make them more "block-like".
Closes NPPD-1212
How to test the changes in this Pull Request:
Other information: