Plugin Directory

Changeset 2726861


Ignore:
Timestamp:
05/19/2022 01:44:30 PM (4 years ago)
Author:
allanjardine
Message:

Add support for conditions in short tag and release 1.1.0

Location:
cloudtables/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cloudtables/trunk/Api.php

    r2324965 r2726861  
    1616    private $_clientName = null;
    1717    private $_accessToken = null;
     18    private $_conditions = null;
    1819
    1920    /**
     
    6263            $this->_clientName = $options['clientName'];
    6364        }
     65
     66        if ($options && isset($options['conditions'])) {
     67            $this->_conditions = $options['conditions'];
     68        }
    6469    }
    6570
     
    110115            return $json['token'];
    111116        }
     117    }
     118
     119    /**
     120     * Set conditions
     121     */
     122    public function conditions($cond) {
     123        $this->_conditions = $cond;
     124
     125        return $this;
    112126    }
    113127
     
    190204        }
    191205
     206        if ($this->_conditions) {
     207            $data['conditions'] = $this->_conditions;
     208        }
     209
    192210        if ($method === 'get') {
    193211            $response = wp_remote_get( $url, [
     
    204222
    205223        $result = wp_remote_retrieve_body($response);
    206         return json_decode($result, true);
     224        $json = json_decode($result, true);
     225
     226        if (! $json['success']) {
     227            echo 'Warning - CloudTables error: ' . json_encode($json['errors']);
     228        }
     229        return $json;
    207230    }
    208231   
     
    217240    }
    218241}
     242
  • cloudtables/trunk/cloudtables.php

    r2324965 r2726861  
    272272
    273273        $api = $this->_api_inst($key);
     274
     275        if (isset($attrs['conditions'])) {
     276            $api->conditions($attrs['conditions']);
     277        }
    274278
    275279        wp_register_style(
     
    404408register_deactivation_hook( __FILE__, 'CloudTables::deactivate' );
    405409register_uninstall_hook( __FILE__, 'CloudTables::uninstall' );
     410
  • cloudtables/trunk/package.json

    r2324965 r2726861  
    11{
    22  "name": "cloudtables-wordpress",
    3   "version": "1.0.0",
     3  "version": "1.1.0",
    44  "description": "CloudTables easy integration plug-in for WordPress",
    55  "main": "block.js",
  • cloudtables/trunk/readme.txt

    r2324965 r2726861  
    22Tags: CloudTables, DataTables, Editor, SpryMedia
    33Requires at least: 5.0
    4 Tested up to: 5.4
    5 Stable tag: 1.0.0
     4Tested up to: 5.9
     5Stable tag: 1.1.0
    66Requires PHP: 5.5.0
    77License: GPLv2 or later
     
    4949== Changelog ==
    5050
     51= 1.1.0 - 19 May 2022 =
     52
     53* Add support for `conditions` in short tag
     54
    5155= 1.0.0 - 22 May 2020 =
    5256
Note: See TracChangeset for help on using the changeset viewer.