Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_size_names_choose

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
684                <label class="setting">
685                     <span><?php _e('Size'); ?></span>
686                     <select class="size" name="size"
687                          data-setting="size"
688                          <# if ( data.userSettings ) { #>
689                               data-user-setting="imgsize"
690                          <# } #>>
691                          <?php
692                          /** This filter is documented in wp-admin/includes/media.php */
693                          $sizes = apply_filters( 'image_size_names_choose', array(
694                               'thumbnail' => __('Thumbnail'),
695                               'medium'    => __('Medium'),
696                               'large'     => __('Large'),
697                               'full'      => __('Full Size'),
698                          ) );
699
700                          foreach ( $sizes as $value => $name ) : ?>
701                               <#
702                               var size = data.sizes['<?php echo esc_js( $value ); ?>'];
 
Line Code
759                <span><?php _e( 'Size' ); ?></span>
760                <select class="size" name="size"
761                     data-setting="size"
762                     <# if ( data.userSettings ) { #>
763                          data-user-setting="imgsize"
764                     <# } #>
765                     >
766                     <?php
767                     /** This filter is documented in wp-admin/includes/media.php */
768                     $size_names = apply_filters( 'image_size_names_choose', array(
769                          'thumbnail' => __( 'Thumbnail' ),
770                          'medium'    => __( 'Medium' ),
771                          'large'     => __( 'Large' ),
772                          'full'      => __( 'Full Size' ),
773                     ) );
774
775                     foreach ( $size_names as $size => $label ) : ?>
776                          <option value="<?php echo esc_attr( $size ); ?>">
777                               <?php echo esc_html( $label ); ?>
 
Line Code
933                                    <label class="setting size">
934                                         <span><?php _e('Size'); ?></span>
935                                         <select class="size" name="size"
936                                              data-setting="size"
937                                              <# if ( data.userSettings ) { #>
938                                                   data-user-setting="imgsize"
939                                              <# } #>>
940                                              <?php
941                                              /** This filter is documented in wp-admin/includes/media.php */
942                                              $sizes = apply_filters( 'image_size_names_choose', array(
943                                                   'thumbnail' => __('Thumbnail'),
944                                                   'medium'    => __('Medium'),
945                                                   'large'     => __('Large'),
946                                                   'full'      => __('Full Size'),
947                                              ) );
948
949                                              foreach ( $sizes as $value => $name ) : ?>
950                                                   <#
951                                                   var size = data.sizes['<?php echo esc_js( $value ); ?>'];