[wp-trac] [WordPress Trac] #22911: new media dialog doesn't list custom image sizes
WordPress Trac
noreply at wordpress.org
Thu Dec 13 10:52:24 UTC 2012
#22911: new media dialog doesn't list custom image sizes
--------------------------+------------------------------
Reporter: wdfee | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------------------
Comment (by wdfee):
Hi nacin, unfortunately I didn't got it working. I tried this in the
theme's functions.php:
1. first trial
{{{
add_filter('image_size_names_choose', 'my_image_sizes');
function my_image_sizes($sizes) {
$addsizes = array(
"my-size" => __( "My Size")
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
}}}
2. second trial
{{{
add_filter('image_size_names_choose', 'my_image_sizes', 11, 1);
function my_image_sizes($sizes) {
$new_sizes = array();
$added_sizes = get_intermediate_image_sizes();
foreach( $added_sizes as $key => $value) {
$new_sizes[$value] = $value;
}
$new_sizes = array_merge( $new_sizes, $sizes );
return $new_sizes;
}
}}}
Also tried a print_r(get_intermediate_image_sizes()); in the themes
header, it's giving nothing back.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22911#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list