Skip to content

Gallery: update the get_post_galleries method to account for gallery blocks#1783

Closed
glendaviesnz wants to merge 1 commit intoWordPress:masterfrom
glendaviesnz:update/get-post-galleries
Closed

Gallery: update the get_post_galleries method to account for gallery blocks#1783
glendaviesnz wants to merge 1 commit intoWordPress:masterfrom
glendaviesnz:update/get-post-galleries

Conversation

@glendaviesnz
Copy link
Copy Markdown

@glendaviesnz glendaviesnz commented Oct 27, 2021

Description

Currently the get_post_galleries method will only handle gallery shortcodes. A trac ticket has been open for some time to rectify this, and in the meantime a new version of the gallery block is about to be released which uses innerblocks, so the diffs on this ticket will no longer be sufficient.

This PR adds support for both versions of the gallery block

To test:

  • Check out this PR to local wp dev env along with the latest version of the gutenberg plugin
  • Add a theme that makes use of the get_post_galleries method, eg. Arbutus
  • Add several posts using the Gallery post type - add a short code, gallery block, and v2 gallery block (turn on gallery experiment to add a v2 block)
  • The the homepage of the site and check that all 3 galleries display as expected

Screen Shot 2021-10-27 at 4 06 49 PM

Trac ticket: https://core.trac.wordpress.org/ticket/43826

@glendaviesnz
Copy link
Copy Markdown
Author

Once there is agreement on the way forward with this I will add some additional unit tests

@glendaviesnz
Copy link
Copy Markdown
Author

Closed in favour of #1788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant