Loads the font collection data from a JSON file path.
Parameters
$file
stringrequired- File path to a JSON file containing the font collection data.
Source
private function load_from_file( $file ) {
$data = wp_json_file_decode( $file, array( 'associative' => true ) );
if ( empty( $data ) ) {
return new WP_Error( 'font_collection_decode_error', __( 'Error decoding the font collection JSON file contents.' ) );
}
return $this->sanitize_and_validate_data( $data, array( 'font_families' ) );
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.