Plugin Directory

Changeset 2018123


Ignore:
Timestamp:
01/24/2019 06:42:11 AM (7 years ago)
Author:
AmitDeyUS
Message:

added default value for shortcodes

Location:
marketpowerwp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • marketpowerwp/trunk/leplugin.php

    r2017382 r2018123  
    44 * Plugin Name: Multisoft MarketPowerPRO Tools
    55 * Description: Integration of MarketPowerPro to Wordpress
    6  * Version: 2.2.2
     6 * Version: 2.2.3
    77 * Author: Rodine Mark Paul L. Villar
    88 * Author URI: mailto:dine@multisoft.com?subject=Multisoft+MarketPowerPRO+Tools
  • marketpowerwp/trunk/readme.txt

    r2017382 r2018123  
    33Tags: marketpowerpro, multisoft
    44Requires at least: 3.4+
    5 Stable tag: 2.2.2
    6 Version: 2.2.2
     5Stable tag: 2.2.3
     6Version: 2.2.3
    77Tested up to: 5.0.1
    88License: Commercial
  • marketpowerwp/trunk/src/Multisoft/MPP/Replication/ReplicationController.php

    r2017382 r2018123  
    2828    const OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT = 'check_site_name_path_query_format';
    2929    const OPTION_DEFAULT_REPLICATED_SITE_NAME = 'default_replicated_site_name';
    30    
     30
    3131    private $replicationGateway;
    3232    private $mpp_error_view;
     
    4545            $this->add_filter('option_siteurl', 'replication_site_url');
    4646        }
    47        
    48         if(file_exists(ABSPATH . "logs")){
     47
     48        if (file_exists(ABSPATH . "logs")) {
    4949            $logDir = ABSPATH . "logs";
    50         }else{
     50        } else {
    5151            $logDir = $this->_plugin_dir . '/logs';
    5252        }
    53        
     53
    5454        if (MPP_DEBUG) {
    5555            $logger = new Logger($logDir, LogLevel::DEBUG, array(
     
    7373            [$this, 'index']
    7474        );
    75        
     75
    7676        $this->add_action('wp_enqueue_scripts', 'mppe_enqueue_autoprefix', 99999);
    7777
     
    110110            );
    111111        }
    112        
     112
    113113        $default_replicated_site_name = $this->_config->__get('default_replicated_site_name');
    114114        if ($default_replicated_site_name) {
     
    146146            self::SECTION_MPP_REPLICATION,
    147147            self::OPTION_DEFAULT_REPLICATED_SITE_NAME
    148             );
     148        );
    149149
    150150        $settingsGateway->addSettingsSection(
     
    204204        return $href['scheme'] . '://' . $_SERVER['HTTP_HOST'];
    205205    }
    206    
    207     public function mppe_enqueue_autoprefix(){
     206
     207    public function mppe_enqueue_autoprefix()
     208    {
    208209        $settingsGateway = SettingsGateway::getInstance();
    209210        $autoprefix = $settingsGateway->get(self::OPTION_AUTOPREFIX);
    210211
    211         if($autoprefix){
     212        if ($autoprefix) {
    212213            wp_enqueue_script('mppe-jurlp', $this->_js_dir_url . 'jurlp/jurlp.min.js', ['jquery']);
    213214            wp_register_script('mppe-autoprefix', $this->_js_dir_url . 'mpp/autoprefix.js', ['jquery', 'mppe-jurlp'], '0', true);
    214            
     215
    215216            $replicationGateway = $this->replicationGateway;
    216217            $xxx = $replicationGateway->get_replication_site_name(true);
     
    223224                ]
    224225            );
    225            
     226
    226227            wp_enqueue_script('mppe-autoprefix');
    227         }       
     228        }
    228229    }
    229230
     
    235236
    236237        $info = false;
     238        $default = false;
    237239
    238240        extract(shortcode_atts(array(
    239             "info" => false
     241            "info" => false,
     242            "default" => false
    240243        ), $atts));
    241244
     
    249252            if ($info) {
    250253                $info = str_replace("MPPE_", "", str_replace(""", "", $info));
    251                 return $mppe_info[strtoupper($info)];
     254                $mppe_data = trim($mppe_info[strtoupper($info)]);
     255                if (empty($mppe_data) && $default) {
     256                    $mppe_data = str_replace(""", "", $default);
     257                }
     258                return $mppe_data;
    252259            }
    253260            if ($content) {
     
    276283                    'Multisoft MarketPowerPRO ' .
    277284                    $valid->get_error_code() . ': ' . $valid->get_error_message(),
    278                     'notice-error', false   
     285                    'notice-error', false
    279286                );
    280287            } else if ($valid === false) {
     
    292299    }
    293300
    294     public function mppe_invalid_site_name_redirect() {
     301    public function mppe_invalid_site_name_redirect()
     302    {
    295303        $settingsGateway = SettingsGateway::getInstance();
    296304        $redirection_page = $settingsGateway->get(self::OPTION_NON_EXIST_REDIRECTION);
     
    298306        $prefix = $wpdb->prefix;
    299307        $original_site_url = $wpdb->get_var("SELECT option_value FROM {$prefix}options WHERE option_name = 'siteurl'");
    300         if($redirection_page) {
     308        if ($redirection_page) {
    301309            $url = strtolower(get_permalink($redirection_page));
    302310            $url = Utils::str_replace_first(strtolower(site_url()), $original_site_url, $url);
     
    340348        $replicationView->assign('replicated_site_name', $settingsGateway->get(
    341349            self::OPTION_DEFAULT_REPLICATED_SITE_NAME
    342             ));
     350        ));
    343351        $replicationView->display();
    344352    }
Note: See TracChangeset for help on using the changeset viewer.