Plugin Directory

Changeset 2131236

Timestamp:
07/31/2019 08:00:01 AM (5 years ago)
Author:
sjregan
Message:

feat: 'instashop_gallery_product_source_lang' filter and 'product-source-lang' shortcode attribute

Location:
instashop/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • instashop/trunk/includes/class-instashop-admin-api.php

    r2130888 r2131236  
    33
    44class InstaShop_Admin_API {
    5     // const EMBED_URL = 'https://my.instashopapp.com/wordpress';
    6     const EMBED_URL = 'http://instashopapp.test/wordpress';
    7    
     5    const EMBED_URL = 'https://my.instashopapp.com/wordpress';
     6
    87    /**
    98     * Constructor function
  • instashop/trunk/includes/class-instashop-settings.php

    r2130888 r2131236  
    104104                    'type'          => 'text',
    105105                    'default'       => '',
     106
    106107                ),
    107108                array(
     
    129130                                        .'</div>'."\n"
    130131                                        .'</section>',
     132
    131133                ),
    132134            )
  • instashop/trunk/includes/class-instashop.php

    r2130888 r2131236  
    33
    44class InstaShop {
    5     const JS_GALLERY_URL = 'https://s3.amazonaws.com/instashop/js/embed-1.5.1.js';
    6     const JS_GALLERY_VERSION = '1.5.1';
     5    const JS_GALLERY_URL = 'https://s3.amazonaws.com/instashop/js/.1.js';
     6    const JS_GALLERY_VERSION = '1..1';
    77
    88    /**
     
    182182     *      An array of attributes for the generated div placeholder. All are optional except must have either valid domain or gallery.
    183183     *
    184      *      @type string $class         Additional CSS classes to add to div
    185      *      @type string $source        Fully qualified URL (including trailing slash) indicating location of remote JS (for testing purposes only)
    186      *      @type string $domain        Domain name associated with InstaShop account
    187      *      @type string $gallery       Gallery ID associated with InstaShop account
    188      *      @type string $layout        Gallery layout, must be supported by InstaShop license. One of: grid, layout, collage
    189      *      @type string $theme         Theme to use for display of gallery and modal. One of: light, dark
    190      *      @type bool   $prices        Display prices in modal
    191      *      @type bool   $gallery-pins  Display pins in gallery
    192      *      @type bool   $zoom          Use zoom effect on mouse-over within gallery
    193      *      @type bool   $overlay       Display overlay effect on mouse-over within gallery
    194      *      @type string $overlay-label Overlay label within gallery overlay effect
    195      *      @type string $pin-type      Displayed pin type within gallery and modal. None hides pins in modal. One of: circle, radar, star, none.
     184     *      @type string $class               Additional CSS classes to add to div
     185     *      @type string $source              Fully qualified URL (including trailing slash) indicating location of remote JS (for testing purposes only)
     186     *      @type string $domain              Domain name associated with InstaShop account
     187     *      @type string $gallery             Gallery ID associated with InstaShop account
     188     *      @type string $layout              Gallery layout, must be supported by InstaShop license. One of: grid, layout, collage
     189     *      @type string $theme               Theme to use for display of gallery and modal. One of: light, dark
     190     *      @type bool   $prices              Display prices in modal
     191     *      @type bool   $gallery-pins        Display pins in gallery
     192     *      @type bool   $zoom                Use zoom effect on mouse-over within gallery
     193     *      @type bool   $overlay             Display overlay effect on mouse-over within gallery
     194     *      @type string $overlay-label       Overlay label within gallery overlay effect
     195     *      @type string $pin-type            Displayed pin type within gallery and modal. None hides pins in modal. One of: circle, radar, star, none.
     196     *      @type string $product-source-lang Use product id from specified source language if WPML is enabled.
    196197     * }
    197198     * @access  public
     
    200201     */
    201202    public function gallery_shortcode ( $attr ) {
     203
     204
    202205        $domain = wp_parse_url( get_home_url(), PHP_URL_HOST);
    203206
    204         $attr = shortcode_atts( array(
    205             'class' => false,
    206             'source' => false,
    207             'domain' => $domain,
    208             'gallery' => 'default',
    209             'layout' => false,
    210             'theme' => false,
    211             'prices' => false,
    212             'gallery-pins' => false,
    213             'zoom' => false,
    214             'overlay' => false,
    215             'overlay-label' => false,
    216             'pin-type' => false,
    217         ), $attr, 'instashop' );
    218    
    219         if ( $attr['domain'] == 'false' ) {
     207        $attr = shortcode_atts( array(
     208            'class'               => false,
     209            'source'              => false,
     210            'domain'              => $domain,
     211            'gallery'             => 'default',
     212            'layout'              => false,
     213            'theme'               => false,
     214            'prices'              => false,
     215            'gallery-pins'        => false,
     216            'zoom'                => false,
     217            'overlay'             => false,
     218            'overlay-label'       => false,
     219            'pin-type'            => false,
     220            'product-source-lang' => null,
     221        ), $attr, 'instashop' );
     222
     223        if ( $attr['domain'] == 'false' ) {
    220224            $attr['domain'] = false;
    221225        }
     
    234238        if ( $attr['pin-type'] !== false ) $data['pin-type'] = $attr['pin-type'];
    235239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
    236258        $source = apply_filters( 'instashop_gallery_source', '' );
    237259       
     
    284306                'product-id' => $product_id,
    285307            );
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
    286325
    287326            $source = apply_filters( 'instashop_gallery_source', '' );
     
    299338            wp_register_script( $this->_token . '-gallery', self::get_js_gallery_url(), self::get_js_gallery_version() );
    300339            wp_enqueue_script( $this->_token . '-gallery' );
    301    
     340   
    302341            $output = str_replace( '{data}', $data_string, $template );
    303             echo apply_filters( 'instashop_product_gallery', $output, $attr );
     342            echo apply_filters( 'instashop_product_gallery', $output, $ );
    304343        }
    305344    }
     
    409448     * Log the plugin version number.
    410449     *
    411      * @access  public
     450     * @access  p
    412451     * @since   1.0.0
    413452     */
     
    415454        update_option( $this->_token . '_version', $this->_version );
    416455    }
     456
     457
     458
     459
     460
     461
     462
     463
     464
     465
     466
     467
     468
     469
     470
     471
     472
     473
     474
     475
    417476}
  • instashop/trunk/instashop.php

    r2130888 r2131236  
    22/*
    33 * Plugin Name: InstaShop
    4  * Version: 1.1
     4 * Version: 1.
    55 * Plugin URI: https://instashopapp.com/wordpress/
    66 * Description: Easily embed and manage your InstaShop galleries.
     
    88 * Author URI: https://wearezipline.com/
    99 * Requires at least: 4.0
    10  * Tested up to: 4.8.3
     10 * Tested up to:
    1111 *
    1212 * Text Domain: instashop
     
    3535 */
    3636function InstaShop () {
    37     $instance = InstaShop::instance( __FILE__, '1.1' );
     37    $instance = InstaShop::instance( __FILE__, '1.' );
    3838
    3939    if ( is_null( $instance->settings ) ) {
  • instashop/trunk/package.json

    r1752557 r2131236  
    22    "name": "instashop",
    33    "title": "InstaShop",
    4     "version": "1.0.0",
     4    "version": "1..0",
    55    "homepage": "https://instashopapp.com/",
    66    "main": "Gruntfile.js",
  • instashop/trunk/readme.txt

    r2130888 r2131236  
    33Tags: instashop, instagram, gallery, shopping, woocommerce, social media, embed instagram, hashtag, product gallery
    44Requires at least: 4.0
    5 Tested up to: 4.8.3
     5Tested up to:
    66Requires PHP: 5.2.4
    77Stable tag: trunk
     
    9292== Changelog ==
    9393
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
    94115= 1.1 =
    95116* 2017-11-14
     
    111132== Upgrade Notice ==
    112133
     134
     135
     136
     137
     138
     139
     140
     141
    113142= 1.1 =
    114143* 2017-11-14
Note: See TracChangeset for help on using the changeset viewer.