Media: Add support for v1 and v2 gallery block in get_post_galleries().

The `get_post_galleries()` function only handled galleries from the `[gallery]` shortcode. It did not process gallery blocks.

Introducing v1 and v2 gallery block support in `get_post_galleries()` including support for innerblock nesting.

There are no changes to how the function is called. It detects if the post content has one or more gallery blocks. If detected, it parses the blocks and then processes to add each gallery block's HTML to the array of galleries before being passed through the filter and returned.

Includes integration tests.

Follow-up to [24682], [43309], [48262], [52042].

Props glendaviesnz, costdev, antpb, audrasjb, birgire, celloexpressions, desrosj, hellofromTonya, jeffpaul, lynk, pento, ramonopoly, russhylov, takahashi_fumiki, tellyworth.
Fixes #43826.
Built from https://develop.svn.wordpress.org/trunk@52190


git-svn-id: http://core.svn.wordpress.org/trunk@51782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya
2021-11-16 21:25:03 +00:00
parent 09b9af2c76
commit 4586cfe5a0
2 changed files with 91 additions and 2 deletions

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52189';
$wp_version = '5.9-alpha-52190';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.