Plugin Directory

Changeset 1820264


Ignore:
Timestamp:
02/12/2018 01:52:55 AM (8 years ago)
Author:
tazziedave
Message:

Modification required for WooCommerce update 3.3.1

Location:
wysiwyg-custom-products
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wysiwyg-custom-products/tags/1.1/common/class-layout.php

    r1606288 r1820264  
    3232 *
    3333 * @since      1.0.0
    34  * @updated    1.1.1
     34 * @updated    1.1.6
    3535 */
    3636class Layout {
     
    386386     *
    387387     * @since   1.0.0
    388      * @updated 1.0.8
     388     * @updated 1.1.6
    389389     */
    390390    public function set_size( $size ) {
     
    393393        $this->height = self::DEFAULT_IMAGE_SIZE;
    394394
    395         $attributes = wc_get_image_size( $size );
     395        $attributes = wcp_get_image_size( $size );
    396396        if ( $attributes ) {
    397397            $this->width  = maybe_get( $attributes, 'width', $this->width );
     
    542542        $this->setupWidth         = $layout['SetupWidth'];
    543543        $this->setupHeight        = $layout['SetupHeight'];
    544         $this->width              = $this->setupWidth;  // Assume same for starters
    545         $this->height             = $this->setupHeight;
     544        $this->width = $this->setupWidth;  // Assume same for starters
     545        $this->height = $this->setupHeight;
    546546        $this->scaleX             = 1.0;
    547547        $this->scaleY             = 1.0;
  • wysiwyg-custom-products/tags/1.1/common/utilities.php

    r1815404 r1820264  
    184184 * @return array Array of dimensions including width, height, and cropping mode. Cropping mode is 0 for no crop, and 1 for hard crop.
    185185 *
    186  * @since 1.1.4
     186 * @since   1.1.4
     187 * @updated 1.1.6
    187188 */
    188189function wcp_get_image_size( $image_size, $attachmentId = null ) {
     
    197198        $size['width']  = maybe_get( $meta, 'width', $size['width'] );
    198199        $size['height'] = maybe_get( $meta, 'height', $size['height'] );
    199         return $size;
    200     }
    201 
    202     return \wc_get_image_size($image_size);
    203 }
     200    } else {
     201        $wc_size = \wc_get_image_size( $image_size );
     202        if (\is_numeric($wc_size['width'])) {
     203            $size['width'] = $wc_size['width'];
     204        }
     205        if (\is_numeric($wc_size['height'])) {
     206            $size['height'] = $wc_size['height'];
     207        }
     208    }
     209
     210    return $size;
     211}
  • wysiwyg-custom-products/tags/1.1/readme.txt

    r1816077 r1820264  
    133133* Fixed introduced PHP 5 compatibility bug.
    134134
     135= 1.1.6 =
     136* Quick fix for another WooCommerce change in Version 3.3.1 - future upgrade will remove dependencies on WooCommerce image handling routines.
     137
    135138== Upgrade Notice ==
    136 Fixed for WooCommerce 3.3.0 changes. Fixed bug that affected image sizing.
     139Fixed for WooCommerce 3.3.0, 3.3.1 changes. Fixed bug that affected image sizing.
    137140
    138141== Creating Layouts - Instructions ==
  • wysiwyg-custom-products/tags/1.1/wysiwyg-custom-products.php

    r1816077 r1820264  
    44 * Plugin URI: https://tazziedave.com/wp-plugins/wysiwyg-custom-products
    55 * Description: Enables a live WYSIWYG preview of custom products where text is edited in text area or text field in woo commerce.
    6  * Version: 1.1.5
     6 * Version: 1.1.6
    77 * Author: Tazziedave
    88 * Author URI: https://tazziedave.com
     
    6262 *
    6363 * @since   1.0.0
    64  * @updated 1.1.5
     64 * @updated 1.1.6
    6565 */
    6666class Wcp_Plugin {
     
    7474     *  Plug in version
    7575     */
    76     const VER = '1.1.5';
     76    const VER = '1.1.6';
    7777    /**
    7878     * Database version. Used in class-plugin to run updates as necessary
  • wysiwyg-custom-products/trunk/common/class-layout.php

    r1606288 r1820264  
    3232 *
    3333 * @since      1.0.0
    34  * @updated    1.1.1
     34 * @updated    1.1.6
    3535 */
    3636class Layout {
     
    386386     *
    387387     * @since   1.0.0
    388      * @updated 1.0.8
     388     * @updated 1.1.6
    389389     */
    390390    public function set_size( $size ) {
     
    393393        $this->height = self::DEFAULT_IMAGE_SIZE;
    394394
    395         $attributes = wc_get_image_size( $size );
     395        $attributes = wcp_get_image_size( $size );
    396396        if ( $attributes ) {
    397397            $this->width  = maybe_get( $attributes, 'width', $this->width );
     
    542542        $this->setupWidth         = $layout['SetupWidth'];
    543543        $this->setupHeight        = $layout['SetupHeight'];
    544         $this->width              = $this->setupWidth;  // Assume same for starters
    545         $this->height             = $this->setupHeight;
     544        $this->width = $this->setupWidth;  // Assume same for starters
     545        $this->height = $this->setupHeight;
    546546        $this->scaleX             = 1.0;
    547547        $this->scaleY             = 1.0;
  • wysiwyg-custom-products/trunk/common/utilities.php

    r1815404 r1820264  
    184184 * @return array Array of dimensions including width, height, and cropping mode. Cropping mode is 0 for no crop, and 1 for hard crop.
    185185 *
    186  * @since 1.1.4
     186 * @since   1.1.4
     187 * @updated 1.1.6
    187188 */
    188189function wcp_get_image_size( $image_size, $attachmentId = null ) {
     
    197198        $size['width']  = maybe_get( $meta, 'width', $size['width'] );
    198199        $size['height'] = maybe_get( $meta, 'height', $size['height'] );
    199         return $size;
    200     }
    201 
    202     return \wc_get_image_size($image_size);
    203 }
     200    } else {
     201        $wc_size = \wc_get_image_size( $image_size );
     202        if (\is_numeric($wc_size['width'])) {
     203            $size['width'] = $wc_size['width'];
     204        }
     205        if (\is_numeric($wc_size['height'])) {
     206            $size['height'] = $wc_size['height'];
     207        }
     208    }
     209
     210    return $size;
     211}
  • wysiwyg-custom-products/trunk/readme.txt

    r1816077 r1820264  
    133133* Fixed introduced PHP 5 compatibility bug.
    134134
     135= 1.1.6 =
     136* Quick fix for another WooCommerce change in Version 3.3.1 - future upgrade will remove dependencies on WooCommerce image handling routines.
     137
    135138== Upgrade Notice ==
    136 Fixed for WooCommerce 3.3.0 changes. Fixed bug that affected image sizing.
     139Fixed for WooCommerce 3.3.0, 3.3.1 changes. Fixed bug that affected image sizing.
    137140
    138141== Creating Layouts - Instructions ==
  • wysiwyg-custom-products/trunk/wysiwyg-custom-products.php

    r1816077 r1820264  
    44 * Plugin URI: https://tazziedave.com/wp-plugins/wysiwyg-custom-products
    55 * Description: Enables a live WYSIWYG preview of custom products where text is edited in text area or text field in woo commerce.
    6  * Version: 1.1.5
     6 * Version: 1.1.6
    77 * Author: Tazziedave
    88 * Author URI: https://tazziedave.com
     
    6262 *
    6363 * @since   1.0.0
    64  * @updated 1.1.5
     64 * @updated 1.1.6
    6565 */
    6666class Wcp_Plugin {
     
    7474     *  Plug in version
    7575     */
    76     const VER = '1.1.5';
     76    const VER = '1.1.6';
    7777    /**
    7878     * Database version. Used in class-plugin to run updates as necessary
Note: See TracChangeset for help on using the changeset viewer.