/** * Get the Post's schema, conforming to JSON Schema. * * @return array */ public function get_item_schema() { $schema = parent::get_item_schema(); $schema['properties']['content'] = array('description' => __('Object mapping setting ID to an object of setting params, including value.', 'customize-snapshots'), 'type' => 'object', 'context' => array('view', 'edit')); return $schema; }
/** * Retrieves the attachment's schema, conforming to JSON Schema. * * @since 4.7.0 * @access public * * @return array Item schema as an array. */ public function get_item_schema() { $schema = parent::get_item_schema(); $schema['properties']['alt_text'] = array('description' => __('Alternative text to display when attachment is not displayed.'), 'type' => 'string', 'context' => array('view', 'edit', 'embed'), 'arg_options' => array('sanitize_callback' => 'sanitize_text_field')); $schema['properties']['caption'] = array('description' => __('The attachment caption.'), 'type' => 'object', 'context' => array('view', 'edit', 'embed'), 'arg_options' => array('sanitize_callback' => null), 'properties' => array('raw' => array('description' => __('Caption for the attachment, as it exists in the database.'), 'type' => 'string', 'context' => array('edit')), 'rendered' => array('description' => __('HTML caption for the attachment, transformed for display.'), 'type' => 'string', 'context' => array('view', 'edit', 'embed'), 'readonly' => true))); $schema['properties']['description'] = array('description' => __('The attachment description.'), 'type' => 'object', 'context' => array('view', 'edit'), 'arg_options' => array('sanitize_callback' => null), 'properties' => array('raw' => array('description' => __('Description for the object, as it exists in the database.'), 'type' => 'string', 'context' => array('edit')), 'rendered' => array('description' => __('HTML description for the object, transformed for display.'), 'type' => 'string', 'context' => array('view', 'edit'), 'readonly' => true))); $schema['properties']['media_type'] = array('description' => __('Attachment type.'), 'type' => 'string', 'enum' => array('image', 'file'), 'context' => array('view', 'edit', 'embed'), 'readonly' => true); $schema['properties']['mime_type'] = array('description' => __('The attachment MIME type.'), 'type' => 'string', 'context' => array('view', 'edit', 'embed'), 'readonly' => true); $schema['properties']['media_details'] = array('description' => __('Details about the media file, specific to its type.'), 'type' => 'object', 'context' => array('view', 'edit', 'embed'), 'readonly' => true); $schema['properties']['post'] = array('description' => __('The ID for the associated post of the attachment.'), 'type' => 'integer', 'context' => array('view', 'edit')); $schema['properties']['source_url'] = array('description' => __('URL to the original attachment file.'), 'type' => 'string', 'format' => 'uri', 'context' => array('view', 'edit', 'embed'), 'readonly' => true); unset($schema['properties']['password']); return $schema; }
/** * Get the Attachment's schema, conforming to JSON Schema * * @return array */ public function get_item_schema() { $schema = parent::get_item_schema(); $schema['properties']['alt_text'] = array('description' => 'Alternative text to display when attachment is not displayed.', 'type' => 'string', 'context' => array('view', 'edit', 'embed'), 'arg_options' => array('sanitize_callback' => 'sanitize_text_field')); $schema['properties']['caption'] = array('description' => 'The caption for the attachment.', 'type' => 'string', 'context' => array('view', 'edit'), 'arg_options' => array('sanitize_callback' => 'wp_filter_post_kses')); $schema['properties']['description'] = array('description' => 'The description for the attachment.', 'type' => 'string', 'context' => array('view', 'edit'), 'arg_options' => array('sanitize_callback' => 'wp_filter_post_kses')); $schema['properties']['media_type'] = array('description' => 'Type of attachment.', 'type' => 'string', 'enum' => array('image', 'file'), 'context' => array('view', 'edit', 'embed'), 'readonly' => true); $schema['properties']['media_details'] = array('description' => 'Details about the attachment file, specific to its type.', 'type' => 'object', 'context' => array('view', 'edit', 'embed'), 'readonly' => true); $schema['properties']['post'] = array('description' => 'The ID for the associated post of the attachment.', 'type' => 'integer', 'context' => array('view', 'edit')); $schema['properties']['source_url'] = array('description' => 'URL to the original attachment file.', 'type' => 'string', 'format' => 'uri', 'context' => array('view', 'edit', 'embed'), 'readonly' => true); return $schema; }