Created
April 11, 2019 06:46
-
-
Save WordPress-Handbuch/5df5afbdd3e797367eca90c441f3c712 to your computer and use it in GitHub Desktop.
Display new image sizes choices set through add_image_size() also in the backend in the right sidebar when editing an image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_add_image_sizes_to_backend( $existingsizes ) { | |
$addsizes = array( | |
"wh-homepage-teaser" => 'WH Homepage Teaser', | |
"wh-landingpage-stage" => 'WH Landingpage Stage', | |
"wh-detailpage-feature" => 'WH Detailpage Feature' | |
); | |
$newsizes = array_merge( $existingsizes, $addsizes ); | |
return $newsizes; | |
} | |
add_filter( 'image_size_names_choose', 'wh_add_image_sizes_to_backend' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment