/home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers
NameSizeModeActions
open-graph/-0755rm
schema/-0755rm
twitter/-0755rm
aioseo-helper.php12660644editdlrm
asset-helper.php25720644editdlrm
attachment-cleanup-helper.php22940644editdlrm
author-archive-helper.php53750644editdlrm
blocks-helper.php23780644editdlrm
capability-helper.php21160644editdlrm
crawl-cleanup-helper.php82940644editdlrm
curl-helper.php6550644editdlrm
current-page-helper.php165120644editdlrm
date-helper.php32080644editdlrm
environment-helper.php7930644editdlrm
first-time-configuration-notice-helper.php54860644editdlrm
home-url-helper.php6810644editdlrm
image-helper.php119720644editdlrm
import-cursor-helper.php13920644editdlrm
import-helper.php7160644editdlrm
indexable-helper.php94590644editdlrm
indexable-to-postmeta-helper.php96300644editdlrm
indexing-helper.php129920644editdlrm
language-helper.php27160644editdlrm
lock-helper.php29080644editdlrm
meta-helper.php29820644editdlrm
notification-helper.php20570644editdlrm
options-helper.php47580644editdlrm
pagination-helper.php58150644editdlrm
permalink-helper.php16410644editdlrm
post-helper.php55530644editdlrm
post-type-helper.php73500644editdlrm
primary-term-helper.php13980644editdlrm
product-helper.php11030644editdlrm
redirect-helper.php17680644editdlrm
require-file-helper.php3260644editdlrm
robots-helper.php17770644editdlrm
robots-txt-helper.php34780644editdlrm
route-helper.php6940644editdlrm
sanitization-helper.php10560644editdlrm
score-icon-helper.php28460644editdlrm
short-link-helper.php36070644editdlrm
site-helper.php5660644editdlrm
social-profiles-helper.php109910644editdlrm
string-helper.php12180644editdlrm
taxonomy-helper.php51000644editdlrm
url-helper.php83240644editdlrm
user-helper.php40260644editdlrm
wincher-helper.php25690644editdlrm
woocommerce-helper.php13020644editdlrm
wordpress-helper.php5120644editdlrm
wpdb-helper.php9370644editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers/blocks-helper.php (2378B)
post = $post; } /** * Returns all blocks in a given post. * * @param int $post_id The post id. * * @return array The blocks in a block-type => WP_Block_Parser_Block[] format. */ public function get_all_blocks_from_post( $post_id ) { if ( ! $this->has_blocks_support() ) { return []; } $post = $this->post->get_post( $post_id ); return $this->get_all_blocks_from_content( $post->post_content ); } /** * Returns all blocks in a given content. * * @param string $content The content. * * @return array The blocks in a block-type => WP_Block_Parser_Block[] format. */ public function get_all_blocks_from_content( $content ) { if ( ! $this->has_blocks_support() ) { return []; } $collection = []; $blocks = \parse_blocks( $content ); return $this->collect_blocks( $blocks, $collection ); } /** * Checks if the installation has blocks support. * * @codeCoverageIgnore It only checks if a WordPress function exists. * * @return bool True when function parse_blocks exists. */ protected function has_blocks_support() { return \function_exists( 'parse_blocks' ); } /** * Collects an array of blocks into an organised collection. * * @param WP_Block_Parser_Block[] $blocks The blocks. * @param array $collection The collection. * * @return array The blocks in a block-type => WP_Block_Parser_Block[] format. */ private function collect_blocks( $blocks, $collection ) { foreach ( $blocks as $block ) { if ( empty( $block['blockName'] ) ) { continue; } if ( ! isset( $collection[ $block['blockName'] ] ) || ! \is_array( $collection[ $block['blockName'] ] ) ) { $collection[ $block['blockName'] ] = []; } $collection[ $block['blockName'] ][] = $block; if ( isset( $block['innerBlocks'] ) ) { $collection = $this->collect_blocks( $block['innerBlocks'], $collection ); } } return $collection; } }