Gallery shortcode fallback to respect post_gallery filter#10392
Gallery shortcode fallback to respect post_gallery filter#10392antpb wants to merge 2 commits intoWordPress:masterfrom
Conversation
|
Currently having issues getting the render callback function to register in |
@antpb I noticed your comment that the parent issue was resolved. I'm closing this PR. Feel free to reopen if you think that it still needs to be implemented. |
@gziolo, if I understand it correctly, the ability to parse IDs from the gallery still doesn't allow plugin/theme authors to change the markup of a gallery created with the "Gallery" block using the |
|
It's perfectly fine to use the following logic in the plugin and completely override the output which JS code generated with register_block_type(
'core/gallery',
array(
'render_callback' => 'my_plugin_render_block_gallery',
)
);Do you see any issue with such approach? By the way, the long term plan is to have all blocks registered on the server as proposed in #13693. When that happens it should be possible to be able to filter all settings that get registered using |
Description
This PR is an first pass attempt at providing a fallback to the gallery shortcode that will allow support for the post_gallery filter. More information can be found here: #1451
This PR conditionally registers the callback function based on
has_filter( 'post_gallery')I'm opening this PR to have discussion on this approach.