Only the default sizes (thumbnail, medium, large, and full) are available in the row settings for background images (and presumably anywhere else a photo can be selected). I’m using BB 1.6.4.
I have registered the new image sizes from my theme’s functions.php and regenerated all thumbnails:
It appears that I have to add them myself via code, but wouldn’t that be better handled by BB? I think its reasonable to expect your registered thumbnails to show up in the BB options just by registering them via add_image_size().
Thanks for posting! It looks like that used to work, but now I’m not even seeing those sizes in the admin media window either. It looks like as of WP 3.8, you have to use this code as well…
Sorry, I wasn’t clear. I got it working with the image_size_names_choose filter. My comment was supposed to say that I think maybe BB ought to add this filter for us, or is that no longer possible since WP 3.8?
Thanks for the clarification! Pre 3.8 we were able to build out the additional sizes because they were being provided to us by WordPress. It looks like with the introduction of that filter, we’re no longer getting them.
Unfortunately, we wouldn’t be able to implement that filter for you since we don’t know what name/value pairs need to be added to the sizes array. That filter is needed for the core media library in the admin, so it makes sense that it would be needed for BB as well. Sorry I don’t have a better answer for you!
(Occassionally the dropdown will say Banner, but mostly it will say “undefined” and doesn’t correspond to the image size properties set when registering the image size.
UPDATE: I fixed my issue by making sure that the $content_width variable in functions.php is wide enough to accommodate my widest custom size.
For example, in my case I have two custom sizes with a width of 1200. However, in Beaver Builder, they were showing a width of 900. I remembered that my $content_width was also set to 900, so I adjusted it to 1200 and then regenerated thumbnails. Now the custom sizes are showing correctly in Beaver Builder
Just as an aside to Beaver Builder, you guys might want to divorce the relationship between your image size array and $content_width. That variable is also used by Wordpress to set the default width of embedded videos and such. There are plenty of cases where I may want a large image size, but don’t want my videos to be embedded at such large sizes. For example, in my present case, I would prefer that videos be embedded at no larger than 900 pixels, but I have a need for a 1200 pixel image size.
PS
For those who find this helpful, the correct code for setting $content_width is:
if (!isset($content_width)) {
$content_width = 1200;
}
Put this near the top of your functions.php file, outside of any other functions etc.
Just as an aside to Beaver Builder, you guys might want to divorce the relationship between your image size array and $content_width.
We’re actually relying on WordPress for the image size array, so there’s not much we could do there other than forcing a higher content width which might not be optimal for all themes.