Sanitizes the font family settings when creating or updating a font family.
Parameters
$value
stringrequired- Encoded JSON string of font family settings.
Source
public function sanitize_font_family_settings( $value ) {
// Settings arrive as stringified JSON, since this is a multipart/form-data request.
$settings = json_decode( $value, true );
$schema = $this->get_item_schema()['properties']['font_family_settings']['properties'];
// Sanitize settings based on callbacks in the schema.
foreach ( $settings as $key => $value ) {
$sanitize_callback = $schema[ $key ]['arg_options']['sanitize_callback'];
$settings[ $key ] = call_user_func( $sanitize_callback, $value );
}
return $settings;
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.