Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Show custom image sizes in the wordpress editor and media dialog. See
* custom_image_sizes_in_select.
* Add custom images sizes the the size selector in
* the gutenberg editor and the media modal.
* @see
* @uses array_merge
* @uses __()
function custom_image_sizes_in_select($sizes)
return array_merge($sizes, array(
'full-page-width' => __('Full page width'),
'half-page-width' => __('Half page width'),
'square' => __('Square'),
* Hook: image_size_names_choose.
* @uses add_action()
* @uses image_size_names_choose
add_filter('image_size_names_choose', 'custom_image_sizes_in_select');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.