Plugin Directory

Changeset 2728337


Ignore:
Timestamp:
05/23/2022 08:23:08 AM (4 years ago)
Author:
ideaplus
Message:

wordpress ssl兼容功能添加

Location:
ideaplus
Files:
72 added
3 edited

Legend:

Unmodified
Added
Removed
  • ideaplus/trunk/includes/class-ideaplus-plugin-func.php

    r2706822 r2728337  
    256256        return $url;
    257257    }
     258
     259    public static function get_client_headers()
     260    {
     261        $scheme = $_SERVER['HTTP_X_FORWARDED_PROTO'];
     262
     263        if (self::get_option('ideaplus_client_scheme') != $scheme) {
     264            $server = Ideaplus_Plugin_Server::getInstance();
     265            $data = $server->get('shop/check', [], ['scheme'=>$scheme]);
     266
     267            if ($data['code'] == 200) {
     268
     269                $options['ideaplus_client_scheme'] = $scheme;
     270
     271                Ideaplus_Plugin_Func::update_options($options);
     272            }
     273        }
     274    }
    258275}
  • ideaplus/trunk/includes/class-ideaplus-plugin.php

    r2706822 r2728337  
    131131        $this->loader->add_action("plugins_loaded",$this,"addShipping", 20);
    132132
     133        $this->loader->add_action("plugins_loaded",$this,"updateClientScheme", 20);
     134
     135
    133136    }
    134137
     
    140143        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-ideaplus-plugin-shipping.php';
    141144        Ideaplus_Plugin_Shipping::init();
     145    }
     146
     147    /**
     148     * update client scheme
     149     */
     150    public function updateClientScheme()
     151    {
     152        Ideaplus_Plugin_Func::get_client_headers();
    142153    }
    143154
  • ideaplus/trunk/public/js/ideaplus-plugin-product.js

    r2706822 r2728337  
    105105                console.log(666, info);
    106106                let originalSelectedOptionValue = $(this).children('option[value="'+ val +'"]').html();
    107                 let originalSelectId = $(this).parent().parent().find('.label-tag').html().toLowerCase().replace(/\?$/g, '').replace(/\s+/g, '-');
     107                let originalSelectId = $(this).parent().parent().find('.label-tag').html().toLowerCase().replace(/\?$/g, '').replace(/\s+/g, '-').replace(/\(/g, '').replace(/\)/g, '');
    108108                let $root = $(this).parent().parent().parent();
    109109                $root.children('tr[data-parent="'+ aid +'"]').each((index, item) => {
Note: See TracChangeset for help on using the changeset viewer.