Gets the font face’s settings from the post.
Parameters
$post
WP_Postrequired- Font face post object.
Source
protected function get_settings_from_post( $post ) {
$settings = json_decode( $post->post_content, true );
$properties = $this->get_item_schema()['properties']['font_face_settings']['properties'];
// Provide required, empty settings if needed.
if ( null === $settings ) {
$settings = array(
'fontFamily' => '',
'src' => array(),
);
}
// Only return the properties defined in the schema.
return array_intersect_key( $settings, $properties );
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.