WP_REST_Icon_Collections_Controller::get_item_schema
Retrieves the icon collection schema, conforming to JSON Schema.
Метод класса: WP_REST_Icon_Collections_Controller{}
Хуков нет.
Возвращает
array. Item schema data.
Использование
$WP_REST_Icon_Collections_Controller = new WP_REST_Icon_Collections_Controller(); $WP_REST_Icon_Collections_Controller->get_item_schema();
Список изменений
| С версии 7.1.0 | Введена. |
Код WP_REST_Icon_Collections_Controller::get_item_schema() WP REST Icon Collections Controller::get item schema WP 7.1.2
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'icon-collection',
'type' => 'object',
'properties' => array(
'slug' => array(
'description' => __( 'The icon collection slug.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'label' => array(
'description' => __( 'The icon collection label.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'description' => array(
'description' => __( 'The icon collection description.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
),
);
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}