Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Specify custom image dimension for a subset of images
- *
- * @param array $dimensions array(
- * 'width' => 2048,
- * 'height' => 2048
- * )
- * @param $file_path File path for attachment being resized
- * @param $id Attachment id
- *
- * @return array resize dimensions for the image
- *
- */
- add_filter( 'wp_smush_resize_sizes', 'slider_images_dimensions', '', 3 );
- function slider_images_dimensions( $dimensions, $file_path, $id ) {
- $ids_to_be_skipped = array( 59, 60, 61 );
- if ( in_array( $id, $ids_to_be_skipped ) ) {
- $dimensions = array(
- 'width' => 1000,
- 'height' => 1000
- );
- }
- return $dimensions;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement