How to get CMB2 to show a single image at a specific size

You can get ID of the attachment, and then use that to get whichever size you need. https://github.com/CMB2/CMB2/wiki/Field-Types#file A file uploader. By default it will store the file url and allow either attachments or URLs. This field type will also store the attachment ID (useful for getting different image sizes). It will store it in … Read more

Upload thousands of images to WordPress without plugin?

I’ve modified method wp_update_attachment_metadata from wp-includes/post.php (line 5070) to this, just during the Import: /** * Update metadata for an attachment. * * @since 2.1.0 * * @param int $attachment_id Attachment post ID. * @param array $data Attachment meta data. * @return int|bool False if $post is invalid. */ function wp_update_attachment_metadata( $attachment_id, $data ) { … Read more

How to disable the suffix “-scaled” which is being added at the end of each uploaded image?

How to disable this behaviour? Add this to your functions.php: add_filter( ‘big_image_size_threshold’, ‘__return_false’ ); How does it work? When a new image is uploaded, WordPress will detect if it is a “big” image by checking if its height or width exceeds the big_image threshold. The default threshold value is 2560px, filterable with the new big_image_size_threshold … Read more

How to Add extra option to Image Block Settings?

This can be done using block filters. First, you’ll need to filter block attributes for the image block to be able to save the new items: const { addFilter } = wp.hooks; function filterAttributes( settings, name ) { if ( ‘core/image’ === name && settings.attributes ) { settings.attributes.description = { type: ‘string’, default: ” }; … Read more

How to install Imagick or resolve issue

It seems as though you dont have the required permissions to install this PHP extension. This is often the case when youre using shared hosting. The best option is to contact your hosting provider and ask them to install this php extension. However if they provide you with a cpanel dashboard you may be able … Read more

There’s some way to add a wrapper around posted images?

The image_send_to_editor hook passes a whole range of parameters, not just the html. One of them is the size. To get it, hook your filter passing an 8 as the number of supported parameters: add_filter(‘image_send_to_editor’, ‘my_filter_cb’), 10, 8); and modify your function header to grab them all: function my_filter_cb ($html, $id, $caption, $title, $align, $url, … Read more