Changeset 57377 for trunk/src/wp-includes/blocks/gallery.php
- Timestamp:
- 01/29/2024 09:04:18 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/gallery.php
r56710 r57377 32 32 33 33 add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' ); 34 35 /** 36 * Filter to randomize the order of image blocks. 37 * 38 * @param array $parsed_block The block being rendered. 39 * @return array The block object with randomized order of image blocks. 40 */ 41 function block_core_gallery_random_order( $parsed_block ) { 42 if ( 'core/gallery' === $parsed_block['blockName'] && ! empty( $parsed_block['attrs']['randomOrder'] ) ) { 43 shuffle( $parsed_block['innerBlocks'] ); 44 } 45 return $parsed_block; 46 } 47 48 add_filter( 'render_block_data', 'block_core_gallery_random_order' ); 34 49 35 50 /**
Note: See TracChangeset
for help on using the changeset viewer.