WP_Block_Type::prepare_attributes_for_render

Advertisement

Summery Summery

Validates attributes against the current block schema, populating defaulted and missing values.

Syntax Syntax

WP_Block_Type::prepare_attributes_for_render( array $attributes )

Parameters Parameters

$attributes

(Required) Original block attributes.

Return Return

(array) Prepared block attributes.

Source Source

File: wp-includes/class-wp-block-type.php

	public $script = null;

	/**
	 * Block type editor style handle.
	 *
	 * @since 5.0.0
	 * @var string|null
	 */
	public $editor_style = null;

	/**
	 * Block type front end style handle.
	 *
	 * @since 5.0.0
	 * @var string|null
	 */
	public $style = null;

	/**
	 * Constructor.
	 *
	 * Will populate object properties from the provided arguments.
	 *
	 * @since 5.0.0
	 *
	 * @see register_block_type()
	 *
	 * @param string       $block_type Block type name including namespace.
	 * @param array|string $args       Optional. Array or string of arguments for registering a block type.
	 *                                 Default empty array.
	 */
	public function __construct( $block_type, $args = array() ) {
		$this->name = $block_type;

		$this->set_props( $args );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Advertisement

Leave a Reply