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

Line Code
2664      }
2665
2666      if ( current_user_can( 'delete_post', $attachment->ID ) )
2667           $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
2668
2669      if ( $meta && 'image' === $type ) {
2670           $sizes = array();
2671
2672           /** This filter is documented in wp-admin/includes/media.php */
2673           $possible_sizes = apply_filters( 'image_size_names_choose', array(
2674                'thumbnail' => __('Thumbnail'),
2675                'medium'    => __('Medium'),
2676                'large'     => __('Large'),
2677                'full'      => __('Full Size'),
2678           ) );
2679           unset( $possible_sizes['full'] );
2680
2681           // Loop through all potential sizes that may be chosen. Try to do this with some efficiency.
2682           // First: run the image_downsize filter. If it returns something, we can use its data.