Changeset 2185703
- Timestamp:
- 11/04/2019 05:06:03 PM (6 years ago)
- Location:
- wp-smartcrop/trunk
- Files:
-
- 4 edited
-
js/jquery.wp-smartcrop.js (modified) (1 diff)
-
js/jquery.wp-smartcrop.min.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
wp-smartcrop.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-smartcrop/trunk/js/jquery.wp-smartcrop.js
r2180267 r2185703 1 1 /** 2 * jQuery SmartCrop v2.0. 42 * jQuery SmartCrop v2.0.5 3 3 * Copyright (c) 2017 Greg Schoppe 4 4 * License: http://www.opensource.org/licenses/mit-license.php -
wp-smartcrop/trunk/js/jquery.wp-smartcrop.min.js
r2180267 r2185703 1 1 /** 2 * jQuery WP-SmartCrop v2.0. 42 * jQuery WP-SmartCrop v2.0.5 3 3 * Copyright (c) 2017 Greg Schoppe 4 4 * License: http://www.opensource.org/licenses/mit-license.php -
wp-smartcrop/trunk/readme.txt
r2180267 r2185703 112 112 113 113 = 2.0.4 = 114 * Fix potential security concern 115 116 = 2.0.4 = 114 117 * Update admin email 115 118 -
wp-smartcrop/trunk/wp-smartcrop.php
r2180267 r2185703 4 4 * Plugin URI: https://www.wpsmartcrop.com/ 5 5 * Description: Style your images exactly how you want them to appear, for any screen size, and never get a cut-off face. 6 * Version: 2.0. 46 * Version: 2.0.5 7 7 * Author: Bytes.co 8 8 * Author URI: https://bytes.co … … 13 13 if( !class_exists('WP_Smart_Crop') ) { 14 14 class WP_Smart_Crop { 15 public $version = '2.0. 4';15 public $version = '2.0.5'; 16 16 private $plugin_dir_path; 17 17 private $plugin_dir_url; … … 340 340 341 341 function edit_attachment( $attachment_id ) { 342 if( isset( $_REQUEST['attachments'] ) && isset( $_REQUEST['attachments'][$attachment_id] ) ) { 343 $attachment = $_REQUEST['attachments'][$attachment_id]; 344 345 $old_enabled = get_post_meta( $attachment_id, '_wpsmartcrop_enabled', true ); 346 $old_focus = get_post_meta( $attachment_id, '_wpsmartcrop_image_focus', true ); 347 348 if( isset( $attachment['_wpsmartcrop_enabled'] ) && $attachment['_wpsmartcrop_enabled'] == 1 ) { 349 $new_enabled = 1; 350 } else { 351 $new_enabled = false; 352 } 353 if( isset( $attachment['_wpsmartcrop_image_focus'] ) ) { 354 $new_focus = $attachment['_wpsmartcrop_image_focus']; 355 } else { 356 $new_focus = false; 357 } 358 if( ( $new_enabled != $old_enabled ) || ( serialize( $new_focus ) != serialize( $old_focus ) ) ) { 359 update_post_meta( $attachment_id, '_wpsmartcrop_enabled', $new_enabled ); 360 update_post_meta( $attachment_id, '_wpsmartcrop_image_focus', $new_focus ); 361 if( !( isset( $this->options['disable-thumbnails'] ) && $this->options['disable-thumbnails'] ) ) { 362 $this->regenerate_thumbnails( $attachment_id ); 363 } 342 if( ! isset( $_REQUEST['attachments'] ) || ! isset( $_REQUEST['attachments'][$attachment_id] ) ) { 343 return; 344 } 345 $attachment = $_REQUEST['attachments'][$attachment_id]; 346 347 $smartcrop_enabled = boolval( isset( $attachment['_wpsmartcrop_enabled'] ) && $attachment['_wpsmartcrop_enabled'] == 1 ); 348 $smartcrop_image_focus = array( 349 'top' => null, 350 'left' => null 351 ); 352 353 if ( isset( $attachment['_wpsmartcrop_image_focus'] ) ) { 354 if ( isset( $attachment['_wpsmartcrop_image_focus']['top'] ) ) { 355 $smartcrop_image_focus['top'] = number_format( $attachment['_wpsmartcrop_image_focus']['top'], 2 ); 356 } 357 if ( isset( $attachment['_wpsmartcrop_image_focus']['left' ] )) { 358 $smartcrop_image_focus['left'] = number_format ($attachment['_wpsmartcrop_image_focus']['left'], 2 ); 359 } 360 } 361 if ( $smartcrop_image_focus['top'] === null && $smartcrop_image_focus['left'] === null ) { 362 $smartcrop_image_focus = false; 363 } 364 365 unset($attachment); 366 367 $old_enabled = get_post_meta( $attachment_id, '_wpsmartcrop_enabled', true ); 368 $old_focus = get_post_meta( $attachment_id, '_wpsmartcrop_image_focus', true ); 369 370 $new_enabled = $smartcrop_enabled; 371 $new_focus = $smartcrop_image_focus; 372 373 if( ( $new_enabled != $old_enabled ) || ( serialize( $new_focus ) != serialize( $old_focus ) ) ) { 374 update_post_meta( $attachment_id, '_wpsmartcrop_enabled', $new_enabled ); 375 update_post_meta( $attachment_id, '_wpsmartcrop_image_focus', $new_focus ); 376 if( !( isset( $this->options['disable-thumbnails'] ) && $this->options['disable-thumbnails'] ) ) { 377 $this->regenerate_thumbnails( $attachment_id ); 364 378 } 365 379 }
Note: See TracChangeset
for help on using the changeset viewer.