- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-media-gallery.php
r41951 r42343 23 23 */ 24 24 public function __construct() { 25 parent::__construct( 'media_gallery', __( 'Gallery' ), array( 26 'description' => __( 'Displays an image gallery.' ), 27 'mime_type' => 'image', 28 ) ); 29 30 $this->l10n = array_merge( $this->l10n, array( 31 'no_media_selected' => __( 'No images selected' ), 32 'add_media' => _x( 'Add Images', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), 33 'replace_media' => '', 34 'edit_media' => _x( 'Edit Gallery', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), 35 ) ); 25 parent::__construct( 26 'media_gallery', __( 'Gallery' ), array( 27 'description' => __( 'Displays an image gallery.' ), 28 'mime_type' => 'image', 29 ) 30 ); 31 32 $this->l10n = array_merge( 33 $this->l10n, array( 34 'no_media_selected' => __( 'No images selected' ), 35 'add_media' => _x( 'Add Images', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), 36 'replace_media' => '', 37 'edit_media' => _x( 'Edit Gallery', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), 38 ) 39 ); 36 40 } 37 41 … … 48 52 public function get_instance_schema() { 49 53 $schema = array( 50 'title' => array(51 'type' => 'string',52 'default' => '',53 'sanitize_callback' => 'sanitize_text_field',54 'description' => __( 'Title for the widget' ),54 'title' => array( 55 'type' => 'string', 56 'default' => '', 57 'sanitize_callback' => 'sanitize_text_field', 58 'description' => __( 'Title for the widget' ), 55 59 'should_preview_update' => false, 56 60 ), 57 'ids' => array(58 'type' => 'array',59 'items' => array(61 'ids' => array( 62 'type' => 'array', 63 'items' => array( 60 64 'type' => 'integer', 61 65 ), 62 'default' => array(),66 'default' => array(), 63 67 'sanitize_callback' => 'wp_parse_id_list', 64 68 ), 65 'columns' => array(66 'type' => 'integer',69 'columns' => array( 70 'type' => 'integer', 67 71 'default' => 3, 68 72 'minimum' => 1, 69 73 'maximum' => 9, 70 74 ), 71 'size' => array(72 'type' => 'string',73 'enum' => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ),75 'size' => array( 76 'type' => 'string', 77 'enum' => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ), 74 78 'default' => 'thumbnail', 75 79 ), 76 'link_type' => array(77 'type' => 'string',78 'enum' => array( 'post', 'file', 'none' ),79 'default' => 'post',80 'media_prop' => 'link',80 'link_type' => array( 81 'type' => 'string', 82 'enum' => array( 'post', 'file', 'none' ), 83 'default' => 'post', 84 'media_prop' => 'link', 81 85 'should_preview_update' => false, 82 86 ),
Note: See TracChangeset
for help on using the changeset viewer.