WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Block_Type::__construct() public WP 5.0.0

Constructor.

Will populate object properties from the provided arguments.

{} Это метод класса: WP_Block_Type{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WP_Block_Type = new WP_Block_Type();
$WP_Block_Type->__construct( $block_type, $args );
$block_type(строка) (обязательный)
Block type name including namespace.
$args(массив|строка)

Array or string of arguments for registering a block type. Any arguments may be defined, however the ones described below are supported by default.

По умолчанию: empty array

  • api_version(строка)
    Block API version.

  • title(строка)
    Human-readable block type label.

  • category(строка|null)
    Block type category classification, used in search interfaces to arrange block types by category.

  • parent(массив|null)
    Setting parent lets a block require that it is only available when nested within the specified blocks.

  • icon(строка|null)
    Block type icon.

  • description(строка)
    A detailed block type description.

  • keywords(массив)
    Additional keywords to produce block type as result in search interfaces.

  • textdomain(строка|null)
    The translation textdomain.

  • styles(массив)
    Alternative block styles.

  • variations(массив)
    Block variations.

  • supports(массив|null)
    Supported features.

  • example(массив|null)
    Structured data for the block preview.

  • render_callback(callable|null)
    Block type render callback.

  • attributes(массив|null)
    Block type attributes property schemas.

  • uses_context(массив)
    Context values inherited by blocks of this type.

  • provides_context(массив|null)
    Context provided by blocks of this type.

  • editor_script(строка|null)
    Block type editor script handle.

  • script(строка|null)
    Block type front end script handle.

  • editor_style(строка|null)
    Block type editor style handle.

  • style(строка|null)
    Block type front end style handle.

Заметки

Список изменений

С версии 5.0.0 Введена.
С версии 5.5.0 Added the title, category, parent, icon, description, keywords, textdomain, styles, supports, example, uses_context, and provides_context properties.
С версии 5.6.0 Added the api_version property.
С версии 5.8.0 Added the variations property.

Код WP_Block_Type::__construct() WP 5.8.1

public function __construct( $block_type, $args = array() ) {
	$this->name = $block_type;

	$this->set_props( $args );
}