WP_Font_Collection::get_data()publicWP 6.5.0

Retrieves the font collection data.

Метод класса: WP_Font_Collection{}

Хуков нет.

Возвращает

Массив|WP_Error. An array containing the font collection data, or a WP_Error on failure.

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

$WP_Font_Collection = new WP_Font_Collection();
$WP_Font_Collection->get_data();

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

С версии 6.5.0 Введена.

Код WP_Font_Collection::get_data() WP 6.7.1

public function get_data() {
	if ( is_wp_error( $this->data ) ) {
		return $this->data;
	}

	// If the collection uses JSON data, load it and cache the data/error.
	if ( isset( $this->src ) ) {
		$this->data = $this->load_from_json( $this->src );
	}

	if ( is_wp_error( $this->data ) ) {
		return $this->data;
	}

	// Set defaults for optional properties.
	$defaults = array(
		'description' => '',
		'categories'  => array(),
	);

	return wp_parse_args( $this->data, $defaults );
}