Pay With Paypal Block: Add fallback code blocks for different contexts. #17161
Labels
[Block] Pay With Paypal
aka Simple Payments
[Feature] Pay with PayPal
aka Simple Payments
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
On WordPress.com, the Reader, Masterbar notifications, and email notifications are all different contexts in which Gutenberg blocks can be viewed, and they've each got their own limitations and issues with what to render (for example, iframes and other elements are impossible in email, while certain interactions like PayPal purchase buttons are inappropriate in notifications). Blocks need to be able to produce fallback markup when displaying in these different contexts.
In email, we could keep the same layout and styling, and have the PayPal button image just link to the post. We can do the same with notifications, but due to their fixed narrow width, also make any product image full-width (as already happens). It feels like the Reader block can stay just the featured image in the list view, but should be fully functional in the single view (which would require a way to enqueue its necessary front-end JS).
The
render_callback
property can be used directly in blocks we control to define these fallbacks. Let's add context identifiers and code blocks for the Pay With PayPal block, which will also stand as an example for how to handle other blocks.See: paYKcK-FI-p2
See: 217-gh-dotcom-manage
The text was updated successfully, but these errors were encountered: