Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,23 @@ This add-on can be treated as both a WP plugin and a theme include.
1. 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
2. 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');
}
`
```PHP
/**
* Include ACF Image Crop Addon
*/

add_filter('acf/image_crop_settings/url', 'my_image_crop_url', 10, 1);

function my_image_crop_url( $url ) {

$url = get_template_directory_uri() . '/acf-image-crop/';

return $url;

}

include( 'acf-image-crop/acf-image-crop.php' );
```

## Screenshots ##

Expand Down
4 changes: 2 additions & 2 deletions acf-image-crop-v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ function get_image_data($field){


function input_admin_enqueue_scripts() {
$dir = plugin_dir_url( __FILE__ );
$dir = apply_filters( 'acf/image_crop_settings/url', plugin_dir_url( __FILE__ ) );


// // register & include JS
Expand Down Expand Up @@ -846,7 +846,7 @@ function input_admin_footer() {

function field_group_admin_enqueue_scripts() {

$dir = plugin_dir_url( __FILE__ );
$dir = apply_filters( 'acf/image_crop_settings/url', plugin_dir_url( __FILE__ ) );

wp_register_script('acf-input-image-crop-options', "{$dir}js/options.js", array('jquery'));
wp_enqueue_script( 'acf-input-image-crop-options');
Expand Down