Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



get_dynamic_block_names ›

Seit5.0.0
Veraltetn/v
get_dynamic_block_names ( Keine Parameter )
Gibt zurück:
  • (array) Array of dynamic block names.
Definiert in:
Codex:

Returns an array of the names of all registered dynamic block types.



Quellcode

function get_dynamic_block_names() {
	$dynamic_block_names = array();

	$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
	foreach ( $block_types as $block_type ) {
		if ( $block_type->is_dynamic() ) {
			$dynamic_block_names[] = $block_type->name;
		}
	}

	return $dynamic_block_names;
}