WP_REST_Font_Faces_Controller::get_create_params(): array

In this article

Get the params used when creating a new font face.

Return

array Font face create arguments.

Source

public function get_create_params() {
	$properties = $this->get_item_schema()['properties'];
	return array(
		'theme_json_version' => $properties['theme_json_version'],
		// When creating, font_face_settings is stringified JSON, to work with multipart/form-data used
		// when uploading font files.
		'font_face_settings' => array(
			'description'       => __( 'font-face declaration in theme.json format, encoded as a string.' ),
			'type'              => 'string',
			'required'          => true,
			'validate_callback' => array( $this, 'validate_create_font_face_settings' ),
			'sanitize_callback' => array( $this, 'sanitize_font_face_settings' ),
		),
	);
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.