Skip to content

Instantly share code, notes, and snippets.

View timbunch's full-sized avatar
🎮

Tim Bunch timbunch

🎮
  • Rockaway Beach, OR
View GitHub Profile
@timbunch
timbunch / wp-image-crop-position.php
Created July 14, 2017 17:34 — forked from ryanriatno/wp-image-crop-position.php
WordPress: Set an image's crop position and rotates images based on EXIF information if necessary
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**