Plugin Directory

Changeset 3082729


Ignore:
Timestamp:
05/07/2024 05:41:53 PM (23 months ago)
Author:
metalpriceapi
Message:

tagging version 1.0.8

Location:
metalpriceapi
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • metalpriceapi/tags/1.0.8/README.txt

    r2948255 r3082729  
    88Author: MetalpriceAPI
    99Requires at least: 5.0
    10 Tested up to: 6.2.0
    11 Version: 1.0.7
    12 Stable tag: 1.0.7
     10Tested up to: 6.5.2
     11Version: 1.0.8
     12Stable tag: 1.0.8
    1313License: GPLv2 or later
    1414License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6060== Changelog ==
    6161
     62= 1.0.8 =
     63* Add days support
     64
    6265= 1.0.7 =
    6366* Add operation support
  • metalpriceapi/tags/1.0.8/index.php

    r2948255 r3082729  
    4747      'date_format' => 'Y-m-d',
    4848      'date' => null,
     49      'days' => null,
    4950      'price_round' => 2,
    5051      'unit' => null,
     
    5354    ), $attrs);
    5455
    55     $endpoint = isset($attrs['date']) && !empty(trim( $attrs['date'])) ?
    56       date('Y-m-d', strtotime($attrs['date'])) :
    57       'latest';
     56    $endpoint = 'latest';
     57    if (isset($attrs['date']) && !empty(trim($attrs['date']))) {
     58      $endpoint = date('Y-m-d', strtotime($attrs['date']));
     59    } else if (isset($attrs['days']) && !empty(trim($attrs['days'])) && is_numeric($attrs['days']) && $attrs['days'] <= 0) {
     60      $endpoint = date('Y-m-d', strtotime("-{$attrs['days']} days", strtotime('now')));
     61    }
    5862
    5963    $api_key = get_option($this->opt_api_key);
  • metalpriceapi/tags/1.0.8/module/info.php

    r2948255 r3082729  
    6565      <tr>
    6666        <td><b>date</b></td>
    67         <td>If you want to use rates from a specific historical date, you should specify this field in YYYY-MM-DD format. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API.</a> If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API.</a></td>
     67        <td>If you want to use rates from a specific historical date, you should specify this field in YYYY-MM-DD format. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API</a>. If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API</a>.</td>
     68        <td></td>
     69        <td>Live rate will be used.</td>
     70      </tr>
     71      <tr>
     72        <td><b>days</b></td>
     73        <td>The number of days to subtract from the current date to determine the target date for the query. It accepts a negative integer value, where the absolute value represents the number of days to go back in time. For example, -7 would query data from one week ago, -30 would query data from one month ago, and so on. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API</a>. If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API</a>.</td>
    6874        <td></td>
    6975        <td>Live rate will be used.</td>
     
    110116    <li><code>[metalpriceapi date="2021-01-28" date_format="F jS, Y"]</code></li>
    111117    &nbsp;
     118    <li><code>[metalpriceapi days="-1"]</code></li>
     119    &nbsp;
    112120    <li><code>[metalpriceapi base="USD" symbol="XAU" price_round="3" operation="(((value)-5)*10)*0.7"]</code></li>
    113121    &nbsp;
  • metalpriceapi/trunk/README.txt

    r2948255 r3082729  
    88Author: MetalpriceAPI
    99Requires at least: 5.0
    10 Tested up to: 6.2.0
    11 Version: 1.0.7
    12 Stable tag: 1.0.7
     10Tested up to: 6.5.2
     11Version: 1.0.8
     12Stable tag: 1.0.8
    1313License: GPLv2 or later
    1414License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6060== Changelog ==
    6161
     62= 1.0.8 =
     63* Add days support
     64
    6265= 1.0.7 =
    6366* Add operation support
  • metalpriceapi/trunk/index.php

    r2948255 r3082729  
    4747      'date_format' => 'Y-m-d',
    4848      'date' => null,
     49      'days' => null,
    4950      'price_round' => 2,
    5051      'unit' => null,
     
    5354    ), $attrs);
    5455
    55     $endpoint = isset($attrs['date']) && !empty(trim( $attrs['date'])) ?
    56       date('Y-m-d', strtotime($attrs['date'])) :
    57       'latest';
     56    $endpoint = 'latest';
     57    if (isset($attrs['date']) && !empty(trim($attrs['date']))) {
     58      $endpoint = date('Y-m-d', strtotime($attrs['date']));
     59    } else if (isset($attrs['days']) && !empty(trim($attrs['days'])) && is_numeric($attrs['days']) && $attrs['days'] <= 0) {
     60      $endpoint = date('Y-m-d', strtotime("-{$attrs['days']} days", strtotime('now')));
     61    }
    5862
    5963    $api_key = get_option($this->opt_api_key);
  • metalpriceapi/trunk/module/info.php

    r2948255 r3082729  
    6565      <tr>
    6666        <td><b>date</b></td>
    67         <td>If you want to use rates from a specific historical date, you should specify this field in YYYY-MM-DD format. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API.</a> If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API.</a></td>
     67        <td>If you want to use rates from a specific historical date, you should specify this field in YYYY-MM-DD format. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API</a>. If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API</a>.</td>
     68        <td></td>
     69        <td>Live rate will be used.</td>
     70      </tr>
     71      <tr>
     72        <td><b>days</b></td>
     73        <td>The number of days to subtract from the current date to determine the target date for the query. It accepts a negative integer value, where the absolute value represents the number of days to go back in time. For example, -7 would query data from one week ago, -30 would query data from one month ago, and so on. Specifying this option will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_historical">Historical Rates API</a>. If this option is not specified, shortcodes will use the <a target="_blank" href="https://metalpriceapi.com/documentation#api_realtime">Real-Time Rates API</a>.</td>
    6874        <td></td>
    6975        <td>Live rate will be used.</td>
     
    110116    <li><code>[metalpriceapi date="2021-01-28" date_format="F jS, Y"]</code></li>
    111117    &nbsp;
     118    <li><code>[metalpriceapi days="-1"]</code></li>
     119    &nbsp;
    112120    <li><code>[metalpriceapi base="USD" symbol="XAU" price_round="3" operation="(((value)-5)*10)*0.7"]</code></li>
    113121    &nbsp;
Note: See TracChangeset for help on using the changeset viewer.