Plugin Directory

Changeset 2462069


Ignore:
Timestamp:
01/25/2021 07:49:22 AM (5 years ago)
Author:
idofri
Message:

new version-20210125

Location:
woo-pelecard-gateway/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • woo-pelecard-gateway/trunk/includes/Gateway.php

    r2460563 r2462069  
    1010use WC_Subscription;
    1111use WC_Subscriptions_Cart;
    12 use WCML_WC_Gateways;
    1312
    1413/**
     
    7675        $option = parent::get_option( $key, $empty_value );
    7776
    78         if ( function_exists( 'wpml_translate_single_string_filter' ) ) {
     77        if ( $this->is_wcml_active() ) {
    7978            $option = wpml_translate_single_string_filter(
    8079                $option,
    81                 WCML_WC_Gateways::STRINGS_CONTEXT,
     80                \WCML_WC_Gateways::STRINGS_CONTEXT,
    8281                $this->id . '_gateway_' . $key,
    8382                $this->current_language
     
    200199
    201200    /**
     201     * @return bool
     202     */
     203    public function is_wcml_active() {
     204        return function_exists( 'wpml_translate_single_string_filter' ) && class_exists( '\WCML_WC_Gateways' );
     205    }
     206
     207    /**
    202208     * @param $field
    203209     *
     
    313319
    314320    /**
     321     * @todo: support the `payment_range` field type.
     322     *
    315323     * @param $text_keys
    316324     *
     
    320328        if ( isset( $_REQUEST['section'] ) && $this->id === $_REQUEST['section'] ) {
    321329            $form_fields = array_filter( $this->form_fields, function( $setting ) {
    322                 return 'title' !== $setting['type'];
     330                return ! in_array( $setting['type'], [ 'title', 'payment_range' ] );
    323331            } );
    324332
  • woo-pelecard-gateway/trunk/includes/Plugin.php

    r2460563 r2462069  
    1818     * @var string $version
    1919     */
    20     public static $version = '1.4';
     20    public static $version = '1.4.1';
    2121
    2222    /**
  • woo-pelecard-gateway/trunk/includes/Settings.php

    r2460563 r2462069  
    418418
    419419        $field_key = $gateway->get_field_key( $field );
     420        $ranges = array_filter( (array) $gateway->get_option( $field, [] ) );
    420421        ?>
    421422        <tr valign="top">
     
    434435                        </thead>
    435436                        <tbody class="ranges">
    436                         <?php foreach ( $gateway->get_option( $field, [] ) as $i => $range ): ?>
     437                        <?php foreach ( $ranges as $i => $range ): ?>
    437438                            <tr class="range">
    438439                                <td class="sort"></td>
  • woo-pelecard-gateway/trunk/readme.txt

    r2460563 r2462069  
    44Requires at least: 5.3
    55Tested up to: 5.6
    6 Stable tag: 1.4
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5555
    5656== Changelog ==
     57
     58= 1.4.1 =
     59* Fixed WPML/WCML integration.
    5760
    5861= 1.4 =
  • woo-pelecard-gateway/trunk/woocommerce-pelecard-gateway.php

    r2460564 r2462069  
    44 * Plugin URI: https://wordpress.org/plugins/woo-pelecard-gateway/
    55 * Description: Extends WooCommerce with Pelecard payment gateway.
    6  * Version: 1.4
     6 * Version: 1.4.1
    77 * Author: Ido Friedlander
    88 * Author URI: https://profiles.wordpress.org/idofri/
Note: See TracChangeset for help on using the changeset viewer.