GC_Block::__get()

最后更新于:2021-11-26 09:42:29

GC_Block::__get( string$name)

响应s a value from an inaccessible property.

参数

$name

(string) (Required) Property name.

响应

(array|null) Prepared attributes, or null.

源文件

文件: gc-includes/class-gc-block.php

	public function __get( $name ) {
		if ( 'attributes' === $name ) {
			$this->attributes = isset( $this->parsed_block['attrs'] ) ?
				$this->parsed_block['attrs'] :
				array();

			if ( ! is_null( $this->block_type ) ) {
				$this->attributes = $this->block_type->prepare_attributes_for_render( $this->attributes );
			}

			return $this->attributes;
		}

		return null;
	}