WordPress.org

Make WordPress Core

Changeset 36839


Ignore:
Timestamp:
03/03/2016 09:44:26 PM (6 years ago)
Author:
obenland
Message:

Customize: Don't show custom image sizes in the media modal.

Custom image sizes for logos should only be used for their intended purpose.

See #33755.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-custom-logo.php

    r36838 r36839  
    2424        add_action( 'wp_head', array( $this, 'head_text_styles' ) );
    2525        add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) );
    26         add_filter( 'image_size_names_choose', array( $this, 'media_manager_image_sizes' ) );
    2726    }
    2827
     
    6564            remove_theme_mod( 'custom_logo' );
    6665        }
    67     }
    68 
    69     /**
    70      * Makes custom image sizes available to the media manager.
    71      *
    72      * @since 4.5.0
    73      * @access public
    74      *
    75      * @param array $sizes Image sizes.
    76      * @return array All default and registered custom image sizes.
    77      */
    78     public function media_manager_image_sizes( $sizes ) {
    79 
    80         // Get an array of all registered image sizes.
    81         $intermediate = get_intermediate_image_sizes();
    82 
    83         // Is there anything fun to work with?
    84         if ( is_array( $intermediate ) && ! empty( $intermediate ) ) {
    85             foreach ( $intermediate as $key => $size ) {
    86 
    87                 // If the size isn't already in the $sizes array, add it.
    88                 if ( ! array_key_exists( $size, $sizes ) ) {
    89                     $sizes[ $size ] = $size;
    90                 }
    91             }
    92         }
    93 
    94         return $sizes;
    9566    }
    9667
Note: See TracChangeset for help on using the changeset viewer.