Current File : /home/bdmcricketindia.in/public_html/wp-content/plugins/wordpress-seo/src/helpers/blocks-helper.php
<?php

namespace Yoast\WP\SEO\Helpers;

use WP_Block_Parser_Block;

/**
 * A helper object for blocks.
 */
class Blocks_Helper {

	/**
	 * Holds the Post_Helper instance.
	 *
	 * @var Post_Helper
	 */
	private $post;

	/**
	 * Constructs a Blocks_Helper instance.
	 *
	 * @codeCoverageIgnore It handles dependencies.
	 *
	 * @param Post_Helper $post The post helper.
	 */
	public function __construct( Post_Helper $post ) {
		$this->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;
	}
}
BDM Cricket India: tips, teams, tournaments

Recent Posts

1win официальный сайт букмекера — Обзор и зеркало для входа.5746

1win официальный сайт букмекера — Обзор и зеркало для входа ▶️ ИГРАТЬ Содержимое 1win Официальный Сайт Букмекера Обзор и Зеркало для Входа Способ 1: Вход через официальный сайт Способ 2: Вход через зеркало Преимущества и Функции 1win Преимущества 1win Функции 1win Как Зарегистрироваться и Начать Играть на 1win Безопасность и …

Read More »

Официальный сайт Pinco Casino играть онлайн – Вход, Зеркало.406

Пинко Казино Официальный сайт | Pinco Casino играть онлайн – Вход, Зеркало ▶️ ИГРАТЬ Содержимое Pinco Casino – Официальный Сайт и Зеркало для Игроков Официальный сайт и зеркало для игры онлайн Зеркало Pinco Casino – безопасный доступ к игре онлайн В современном мире азартных игр, где каждый день появляются новые …

Read More »

Casibom – casibom casino resmi güncel giriş.6183

Casibom – casibom casino resmi güncel giriş ▶️ OYNAMAK Содержимое Casibom Kasino Hakkında Genel Bilgiler Casibom Kasino Ülkelere Bağlı Olmayan İşlemleri Casibom Kasino Ülkelere Bağlı Olmayan İşlemlerdeki Güvenlik Politikaları Casibom Kasino Oyunları ve Bonuslar Casibom Kasino Güvenlik ve Destek Hizmetleri Güvenlik Sistemi Destek Hizmetleri Casibom, en güvenli ve etkileyici casino …

Read More »

Could the Pinco Casino APK Change the Way You Play_1

Could the Pinco Casino APK Change the Way You Play? Understanding the Pinco Casino APK Benefits of Using the Pinco Casino APK User Experience and Reviews Payment Methods and Transactions Future Trends in Mobile Gaming Applications Engaging in Responsible Gaming Could the Pinco Casino APK Change the Way You Play? …

Read More »

CASHlib Casinos in Deutschland – Was bieten sie?

CASHlib Casinos gewinnen in Deutschland immer mehr an Bedeutung. Diese Casinos ermöglichen es Spielern, anonym und sicher mit Prepaid-Guthaben zu bezahlen – ganz ohne Bankverbindung oder Kreditkarte. Besonders für Nutzer, die auf Datenschutz und schnelle Transaktionen Wert legen, sind sie eine interessante Alternative.

Was bieten CASHlib Casinos?

  • Schnelle und anonyme Einzahlungen ohne Registrierung bei Drittanbietern
  • Breites Spielangebot von Slots bis zu Live-Dealer-Spielen
  • Regelmäßige Aktionen wie Freispiele und Cashback
  • Attraktive Willkommensboni für neue Spieler
  • EU-lizenzierte Anbieter mit hohen Sicherheitsstandards

Ein großer Vorteil von CASHlib ist, dass keine sensiblen Bankdaten im Casino hinterlegt werden müssen. Die Gutscheine sind online oder in vielen Verkaufsstellen erhältlich und können sofort verwendet werden. Dadurch entfällt auch die Notwendigkeit, persönliche Daten bei Einzahlungen preiszugeben – ein echter Pluspunkt für sicherheitsbewusste Spieler.

Viele spielothekgermany.com/de/spielothek/cashlib-casinos/ bieten zudem mobile Kompatibilität, einfache Menüführung und professionellen Spielerschutz. Wer nach einem unkomplizierten Zahlungsweg mit solider Auswahl an Spielen und Bonusangeboten sucht, wird bei diesen Plattformen fündig. Die Kombination aus Bequemlichkeit, Sicherheit und einem attraktiven Bonusangebot macht CASHlib Casinos zu einer beliebten Wahl für deutsche Nutzer.

slot 7