Inventory_Presser_Admin_Photo_Arranger::find_gallery_block( WP_Post $post )

Look at the blocks in a given post for a gallery block with a specific CSS class.


Parameters Parameters

$post

(WP_Post) (Required) A post to examine for our gallery block.


Top ↑

Return Return

(array|false)


Top ↑

Source Source

File: includes/admin/class-admin-photo-arranger.php

	protected function find_gallery_block( $post ) {
		if ( is_int( $post ) ) {
			$post = get_post( $post );
		}
		$blocks = parse_blocks( $post->post_content );
		foreach ( $blocks as $block ) {
			// Is this a core gallery block? With a specific CSS class?
			if ( ! $this->is_gallery_block_with_specific_css_class( $block ) ) {
				continue;
			}
			return $block;
		}
		return false;
	}