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