Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Added crop positions and new hook

Compare
Choose a tag to compare
@junaidbhura junaidbhura released this 10 Mar 12:13
· 70 commits to master since this release

Crop Positions

Added support for crop positions. Images can now be cropped from the top, left, right, bottom or the default: center

Changing:

fly_add_image_size( 'home_page_square', 500, 500, true );

To:

fly_add_image_size( 'home_page_square', 500, 500, array( 'right', 'top' ) );

Crops the image from the top right instead of from the center, which is still the default behavior.

New hook: 'fly_image_created'

You can hook on to when a new fly image is created. Maybe to optimize the image? Maybe just to keep track?

/**
 * Fly Image Created Hook
 *
 * @param  integer $attachment_id
 * @param  string $path
 * @return void
 */
function new_fly_image_created( $attachment_id, $path ) {
    echo 'New image path: ' . $path;
}
add_action( 'fly_image_created', 'new_fly_image_created', 10, 2 );