image_size_names_choose

image_size_names_choose

Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-5.0.3

apply_filters('image_size_names_choose') is found 6 times:

  • /wp-admin/custom-background.php line 547
    	public function wp_set_background_image() {
    		if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
    		$attachment_id = absint($_POST['attachment_id']);
    		/** This filter is documented in wp-admin/includes/media.php */
    		$sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
    		$size = 'thumbnail';
    		if ( in_array( $_POST['size'], $sizes ) )
    			$size = esc_attr( $_POST['size'] );
    
    		update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
    		$url = wp_get_attachment_image_src( $attachment_id, $size );
    
  • /wp-admin/includes/media.php line 1003
    	 *
    	 * @param array $size_names Array of image sizes and their names. Default values
    	 *                          include 'Thumbnail', 'Medium', 'Large', 'Full Size'.
    	 */
    	$size_names = apply_filters( 'image_size_names_choose', array(
    		'thumbnail' => __( 'Thumbnail' ),
    		'medium'    => __( 'Medium' ),
    		'large'     => __( 'Large' ),
    		'full'      => __( 'Full Size' )
    	) );
    
    
  • /wp-includes/media-template.php line 693
    						data-user-setting="imgsize"
    					<# } #>>
    					<?php
    					/** This filter is documented in wp-admin/includes/media.php */
    					$sizes = apply_filters( 'image_size_names_choose', array(
    						'thumbnail' => __('Thumbnail'),
    						'medium'    => __('Medium'),
    						'large'     => __('Large'),
    						'full'      => __('Full Size'),
    					) );
    
    
  • /wp-includes/media-template.php line 768
    				<# } #>
    				>
    				<?php
    				/** This filter is documented in wp-admin/includes/media.php */
    				$size_names = apply_filters( 'image_size_names_choose', array(
    					'thumbnail' => __( 'Thumbnail' ),
    					'medium'    => __( 'Medium' ),
    					'large'     => __( 'Large' ),
    					'full'      => __( 'Full Size' ),
    				) );
    
    
  • /wp-includes/media-template.php line 942
    										data-user-setting="imgsize"
    									<# } #>>
    									<?php
    									/** This filter is documented in wp-admin/includes/media.php */
    									$sizes = apply_filters( 'image_size_names_choose', array(
    										'thumbnail' => __('Thumbnail'),
    										'medium'    => __('Medium'),
    										'large'     => __('Large'),
    										'full'      => __('Full Size'),
    									) );
    
    
  • /wp-includes/media.php line 3178
    	if ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) {
    		$sizes = array();
    
    		/** This filter is documented in wp-admin/includes/media.php */
    		$possible_sizes = apply_filters( 'image_size_names_choose', array(
    			'thumbnail' => __('Thumbnail'),
    			'medium'    => __('Medium'),
    			'large'     => __('Large'),
    			'full'      => __('Full Size'),
    		) );
    		unset( $possible_sizes['full'] );
    

See this hook used in plugins: