W3cubDocs

/WordPress

WP_REST_Font_Faces_Controller::get_create_params(): array

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

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_font_faces_controller/get_create_params