Browser: Chrome 124.0.6367.208
OS: Windows
I added a custom image size in the Bricks child theme. Please note the name I set for the image size - ‘1540px Wide Image Scaled’
<?php
#IMAGE SIZES CUSTOMIZED
add_theme_support( 'post_thumbnails' );
add_image_size( 'image-1540', 1540, 9999);
function img_sizes__tap( $sizes )
{
return array_merge ($sizes, array(
'image-1540' => __( '1540px Wide Image Scaled' ),
)
);
}
add_filter( 'image_size_names_choose', 'img_sizes__tap' );
#/IMAGE SIZES CUSTOMIZED
?>
Below is a screenshot of the Image element’s size control within the Bricks Builder. Please note the highlighted name.
I MAY know why the Bricks Builder does not display the name I set. Please note the highlighted code in the screenshot below from a Bricks’ admin file (includes/admin.php).
I did not know how to change that function in the child theme, so I changed it in the Bricks parent theme as an experiment on a staging website (see code below). The Image element’s size control did not change. Suggestions?
/**
* Add custom image sizes to WordPress media library in admin area
*
* Also used to build dropdown of control 'images' for single image element.
*
* @since 1.0
*/
public function image_size_names_choose( $default_sizes ) {
global $_wp_additional_image_sizes;
$custom_image_sizes = [];
foreach ( $_wp_additional_image_sizes as $key => $value ) {
/*$key_array = explode( '_', $key );
$capitalized_array = [];
foreach ( $key_array as $string ) {
array_push( $capitalized_array, ucfirst( $string ) );
}
$custom_image_sizes[ $key ] = join( ' ', $capitalized_array );*/
$custom_image_sizes[ $key ] = $value;
}
return array_merge( $default_sizes, $custom_image_sizes );
}