Make WordPress Core

Ticket #55840: 55840.3.diff

File 55840.3.diff, 1.3 KB (added by antpb, 2 years ago)
  • src/wp-admin/includes/image-edit.php

     
    252252                        if ( ! is_array( $edit_custom_sizes ) ) {
    253253                                $edit_custom_sizes = get_intermediate_image_sizes();
    254254                        }
     255
     256                        /** This filter is documented in wp-admin/includes/media.php */
     257                        $image_size_names = apply_filters(
     258                                'image_size_names_choose',
     259                                array(
     260                                        'medium'       => __( 'Medium' ),
     261                                        'large'        => __( 'Large' ),
     262                                        'full'         => __( 'Full Size' ),
     263                                )
     264                        );
     265
    255266                        foreach ( array_unique( $edit_custom_sizes ) as $key => $size ) {
    256267                                if ( array_key_exists( $size, $meta['sizes'] ) ) {
    257268                                        if ( 'thumbnail' === $size ) {
     
    260271                                        ?>
    261272                                        <span class="imgedit-label">
    262273                                                <input type="radio" id="imgedit-target-custom<?php echo esc_attr( $key ); ?>" name="imgedit-target-<?php echo $post_id; ?>" value="<?php echo esc_attr( $size ); ?>" />
    263                                                 <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $size ); ?></label>
     274                                                <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( isset( $image_size_names[ $size ] ) ? $image_size_names[ $size ] : $size ); ?></label>
    264275                                        </span>
    265276                                        <?php
    266277                                }