Advanced Custom Fields: Image Crop Add-on - Version 1.1.1

Version Description

  • Removed unsued references and that caused php warnings
  • Added a missing default value that caused a php warning
Download this release

Release Info

Developer andersthorborg
Plugin Icon wp plugin Advanced Custom Fields: Image Crop Add-on
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

Files changed (3) hide show
  1. acf-image-crop-v5.php +6 -7
  2. acf-image-crop.php +1 -1
  3. readme.txt +5 -1
acf-image-crop-v5.php CHANGED
@@ -49,7 +49,8 @@ class acf_field_image_crop extends acf_field_image {
49
  'preview_size' => 'medium',
50
  'save_format' => 'id',
51
  'save_in_media_library' => 'yes',
52
- 'target_size' => 'thumbnail'
 
53
  );
54
 
55
  // add ajax action to be able to retrieve full image size via javascript
@@ -328,7 +329,6 @@ class acf_field_image_crop extends acf_field_image {
328
  <a href="#" class="button button-large cancel-crop-button">Cancel</a> <a href="#" class="button button-large button-primary perform-crop-button">Crop!</a>
329
  </div>
330
  </div>
331
- <!-- <img src="<?php echo $o['url']; ?>" alt=""/> -->
332
  </div>
333
  <a href="#" class="button button-large init-crop-button">Crop</a>
334
  </div>
@@ -440,11 +440,9 @@ class acf_field_image_crop extends acf_field_image {
440
  // wp_enqueue_style('acf-input-image_crop');
441
 
442
  // register acf scripts
443
- wp_register_script('acf-input-image_crop', "{$dir}js/input.js", array('acf-input', 'imgareaselect'), $this->settings['version']);
444
-
445
- wp_register_style('acf-input-image_crop', "{$dir}css/input.css", array('acf-input'), $this->settings['version']);
446
- //wp_register_script( 'jcrop', includes_url( 'js/jcrop/jquery.Jcrop.min.css' ));
447
 
 
448
 
449
  // scripts
450
  wp_enqueue_script(array(
@@ -465,7 +463,8 @@ class acf_field_image_crop extends acf_field_image {
465
  function perform_crop(){
466
  $targetWidth = $_POST['target_width'];
467
  $targetHeight = $_POST['target_height'];
468
- $saveToMediaLibrary = $_POST['save_to_media_library'] == 'yes';
 
469
  $imageData = $this->generate_cropped_image($_POST['id'], $_POST['x1'], $_POST['x2'], $_POST['y1'], $_POST['y2'], $targetWidth, $targetHeight, $saveToMediaLibrary, $_POST['preview_size']);
470
  // $previewUrl = wp_get_attachment_image_src( $id, $_POST['preview_size']);
471
  // $fullUrl = wp_get_attachment_image_src( $id, 'full');
49
  'preview_size' => 'medium',
50
  'save_format' => 'id',
51
  'save_in_media_library' => 'yes',
52
+ 'target_size' => 'thumbnail',
53
+ 'library' => 'all'
54
  );
55
 
56
  // add ajax action to be able to retrieve full image size via javascript
329
  <a href="#" class="button button-large cancel-crop-button">Cancel</a> <a href="#" class="button button-large button-primary perform-crop-button">Crop!</a>
330
  </div>
331
  </div>
 
332
  </div>
333
  <a href="#" class="button button-large init-crop-button">Crop</a>
334
  </div>
440
  // wp_enqueue_style('acf-input-image_crop');
441
 
442
  // register acf scripts
443
+ wp_register_script('acf-input-image_crop', "{$dir}js/input.js", array('acf-input', 'imgareaselect'));
 
 
 
444
 
445
+ wp_register_style('acf-input-image_crop', "{$dir}css/input.css", array('acf-input'));
446
 
447
  // scripts
448
  wp_enqueue_script(array(
463
  function perform_crop(){
464
  $targetWidth = $_POST['target_width'];
465
  $targetHeight = $_POST['target_height'];
466
+
467
+ $saveToMediaLibrary = isset($_POST['save_to_media_library']) && $_POST['save_to_media_library'] == 'yes';
468
  $imageData = $this->generate_cropped_image($_POST['id'], $_POST['x1'], $_POST['x2'], $_POST['y1'], $_POST['y2'], $targetWidth, $targetHeight, $saveToMediaLibrary, $_POST['preview_size']);
469
  // $previewUrl = wp_get_attachment_image_src( $id, $_POST['preview_size']);
470
  // $fullUrl = wp_get_attachment_image_src( $id, 'full');
acf-image-crop.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields: Image Crop Add-on
4
  Plugin URI: https://github.com/andersthorborg/ACF-Image-Crop
5
  Description: An image field making it possible/required for the user to crop the selected image to the specified image size or dimensions
6
- Version: 1.1
7
  Author: Anders Thorborg
8
  Author URI: http://thorb.org
9
  License: GPLv2 or later
3
  Plugin Name: Advanced Custom Fields: Image Crop Add-on
4
  Plugin URI: https://github.com/andersthorborg/ACF-Image-Crop
5
  Description: An image field making it possible/required for the user to crop the selected image to the specified image size or dimensions
6
+ Version: 1.1.1
7
  Author: Anders Thorborg
8
  Author URI: http://thorb.org
9
  License: GPLv2 or later
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: andersthorborg
3
  Tags: afc, advanced custom fields, image crop, image, crop
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
- Stable tag: 1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -61,6 +61,10 @@ function my_register_fields()
61
 
62
  == Changelog ==
63
 
 
 
 
 
64
  = 1.1 =
65
  * Added ACF5 compatibility.
66
  * Please report any compatibility issues. As this has been an urgent feature request I have not had as much time for testing as I would have liked.
3
  Tags: afc, advanced custom fields, image crop, image, crop
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
61
 
62
  == Changelog ==
63
 
64
+ = 1.1.1 =
65
+ * Removed unsued references and that caused php warnings
66
+ * Added a missing default value that caused a php warning
67
+
68
  = 1.1 =
69
  * Added ACF5 compatibility.
70
  * Please report any compatibility issues. As this has been an urgent feature request I have not had as much time for testing as I would have liked.