Retrieves the font collection data.
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 );
}
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_font_collection/get_data