phpcs
This commit is contained in:
parent
6e83fcec50
commit
ebde2d64fb
|
@ -7,9 +7,7 @@
|
|||
* @since 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'WP_Async_Request', false ) ) {
|
||||
include_once dirname( __FILE__ ) . '/libraries/wp-async-request.php';
|
||||
|
@ -121,6 +119,7 @@ class WC_Regenerate_Images_Request extends WP_Background_Process {
|
|||
/**
|
||||
* Returns only WC image sizes.
|
||||
*
|
||||
* @param array $sizes Sizes to generate.
|
||||
* @return array
|
||||
*/
|
||||
public function adjust_intermediate_image_sizes( $sizes ) {
|
||||
|
|
|
@ -4,16 +4,12 @@
|
|||
*
|
||||
* All functionality pertaining to regenerating product images in realtime.
|
||||
*
|
||||
* @category Images
|
||||
* @package WooCommerce/Classes
|
||||
* @author Automattic
|
||||
* @version 3.3.0
|
||||
* @since 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Regenerate Images Class
|
||||
|
@ -31,7 +27,7 @@ class WC_Regenerate_Images {
|
|||
* Init function
|
||||
*/
|
||||
public static function init() {
|
||||
include_once( WC_ABSPATH . 'includes/class-wc-regenerate-images-request.php' );
|
||||
include_once WC_ABSPATH . 'includes/class-wc-regenerate-images-request.php';
|
||||
self::$background_process = new WC_Regenerate_Images_Request();
|
||||
|
||||
if ( apply_filters( 'woocommerce_resize_images', true ) && ! is_admin() ) {
|
||||
|
@ -96,7 +92,7 @@ class WC_Regenerate_Images {
|
|||
}
|
||||
|
||||
if ( ! function_exists( 'wp_crop_image' ) ) {
|
||||
include( ABSPATH . 'wp-admin/includes/image.php' );
|
||||
include ABSPATH . 'wp-admin/includes/image.php';
|
||||
}
|
||||
|
||||
$wp_uploads = wp_upload_dir( null, false );
|
||||
|
@ -111,6 +107,7 @@ class WC_Regenerate_Images {
|
|||
|
||||
$info = pathinfo( $original_image_file_path );
|
||||
$ext = $info['extension'];
|
||||
|
||||
list( $orig_w, $orig_h ) = getimagesize( $original_image_file_path );
|
||||
// Get image size after cropping.
|
||||
$image_size = wc_get_image_size( $size );
|
||||
|
|
Loading…
Reference in New Issue