ACF image crop is an extended version of the native Image-field in ACF.
The field gives the developer/administrator the option to predefine a size for the image, which the user is prompted to crop on the various edit screens. This solves the common issue of images being cropped inappropriately by the automated center-crop, that wordpress performs.
The plugin supports the defined image sizes as well as a custom option, enabling the developer to specify the dimensions from within the field edit screen.
The field can be configured to enforce a hard crop or a minimal-dimension-based crop. The hard crop will lock the aspect ratio of the crop where as the minimal-dimension-based crop will not allow the user to crop the image below the specified dimensions.
This plugin diverts from plugins like
Manual Image Crop in that when the user crops an image, a new attachment is generated, so that the relevant crop only applies in the context it is edited. It also keeps the user from dealing with the concept of various image sizes.
As of version 1.0 the field can be configured to either create the cropped image as a media-item (the default behavior) or simply create it and refer directly to the file without adding it to the media library. This will prevent the media library from being cluttered with several cropped versions of the same image. When this option is selected the only available return type for the field is URL.
Compatibility
This add-on will work with:
This add-on can be treated as both a WP plugin and a theme include.
Plugin
- Copy the 'acf-image_crop' folder into your plugins folder
- Activate the plugin via the Plugins admin page
Include
- Copy the 'acf-image_crop' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
- Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-image_crop.php file)
`
add_action('acf/register_fields', 'my_register_fields');
function my_register_fields()
{
include_once('acf-image-crop/acf-image-crop.php');
}
`