Changeset 36839
- Timestamp:
- 03/03/2016 09:44:26 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-custom-logo.php
r36838 r36839 24 24 add_action( 'wp_head', array( $this, 'head_text_styles' ) ); 25 25 add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) ); 26 add_filter( 'image_size_names_choose', array( $this, 'media_manager_image_sizes' ) );27 26 } 28 27 … … 65 64 remove_theme_mod( 'custom_logo' ); 66 65 } 67 }68 69 /**70 * Makes custom image sizes available to the media manager.71 *72 * @since 4.5.073 * @access public74 *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;95 66 } 96 67
Note: See TracChangeset
for help on using the changeset viewer.