Make WordPress Core


Ignore:
Timestamp:
09/29/2014 03:44:25 AM (12 years ago)
Author:
wonderboymusic
Message:

Add size to the UI for Gallery Settings in the media modal. Ensure that the TinyMCE view is refreshed when size changes.

Props richardmtl, noplanman, wonderboymusic.
Fixes #18143.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r29764 r29779  
    734734                        <span><?php _e( 'Random Order' ); ?></span>
    735735                        <input type="checkbox" data-setting="_orderbyRandom" />
     736                </label>
     737
     738                <label class="setting size">
     739                        <span><?php _e( 'Size' ); ?></span>
     740                        <select class="size" name="size"
     741                                data-setting="size"
     742                                <# if ( data.userSettings ) { #>
     743                                        data-user-setting="imgsize"
     744                                <# } #>
     745                                >
     746                                <?php
     747                                // This filter is documented in wp-admin/includes/media.php
     748                                $size_names = apply_filters( 'image_size_names_choose', array(
     749                                        'thumbnail' => __( 'Thumbnail' ),
     750                                        'medium'    => __( 'Medium' ),
     751                                        'large'     => __( 'Large' ),
     752                                        'full'      => __( 'Full Size' ),
     753                                ) );
     754
     755                                foreach ( $size_names as $size => $label ) : ?>
     756                                        <option value="<?php echo esc_attr( $size ); ?>">
     757                                                <?php echo esc_html( $label ); ?>
     758                                        </option>
     759                                <?php endforeach; ?>
     760                        </select>
    736761                </label>
    737762        </script>
Note: See TracChangeset for help on using the changeset viewer.