Changeset 3082729
- Timestamp:
- 05/07/2024 05:41:53 PM (23 months ago)
- Location:
- metalpriceapi
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.8 (copied) (copied from metalpriceapi/trunk)
-
tags/1.0.8/README.txt (modified) (2 diffs)
-
tags/1.0.8/index.php (modified) (2 diffs)
-
tags/1.0.8/module/info.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/index.php (modified) (2 diffs)
-
trunk/module/info.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
metalpriceapi/tags/1.0.8/README.txt
r2948255 r3082729 8 8 Author: MetalpriceAPI 9 9 Requires at least: 5.0 10 Tested up to: 6. 2.011 Version: 1.0. 712 Stable tag: 1.0. 710 Tested up to: 6.5.2 11 Version: 1.0.8 12 Stable tag: 1.0.8 13 13 License: GPLv2 or later 14 14 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 60 60 == Changelog == 61 61 62 = 1.0.8 = 63 * Add days support 64 62 65 = 1.0.7 = 63 66 * Add operation support -
metalpriceapi/tags/1.0.8/index.php
r2948255 r3082729 47 47 'date_format' => 'Y-m-d', 48 48 'date' => null, 49 'days' => null, 49 50 'price_round' => 2, 50 51 'unit' => null, … … 53 54 ), $attrs); 54 55 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 } 58 62 59 63 $api_key = get_option($this->opt_api_key); -
metalpriceapi/tags/1.0.8/module/info.php
r2948255 r3082729 65 65 <tr> 66 66 <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> 68 74 <td></td> 69 75 <td>Live rate will be used.</td> … … 110 116 <li><code>[metalpriceapi date="2021-01-28" date_format="F jS, Y"]</code></li> 111 117 118 <li><code>[metalpriceapi days="-1"]</code></li> 119 112 120 <li><code>[metalpriceapi base="USD" symbol="XAU" price_round="3" operation="(((value)-5)*10)*0.7"]</code></li> 113 121 -
metalpriceapi/trunk/README.txt
r2948255 r3082729 8 8 Author: MetalpriceAPI 9 9 Requires at least: 5.0 10 Tested up to: 6. 2.011 Version: 1.0. 712 Stable tag: 1.0. 710 Tested up to: 6.5.2 11 Version: 1.0.8 12 Stable tag: 1.0.8 13 13 License: GPLv2 or later 14 14 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 60 60 == Changelog == 61 61 62 = 1.0.8 = 63 * Add days support 64 62 65 = 1.0.7 = 63 66 * Add operation support -
metalpriceapi/trunk/index.php
r2948255 r3082729 47 47 'date_format' => 'Y-m-d', 48 48 'date' => null, 49 'days' => null, 49 50 'price_round' => 2, 50 51 'unit' => null, … … 53 54 ), $attrs); 54 55 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 } 58 62 59 63 $api_key = get_option($this->opt_api_key); -
metalpriceapi/trunk/module/info.php
r2948255 r3082729 65 65 <tr> 66 66 <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> 68 74 <td></td> 69 75 <td>Live rate will be used.</td> … … 110 116 <li><code>[metalpriceapi date="2021-01-28" date_format="F jS, Y"]</code></li> 111 117 118 <li><code>[metalpriceapi days="-1"]</code></li> 119 112 120 <li><code>[metalpriceapi base="USD" symbol="XAU" price_round="3" operation="(((value)-5)*10)*0.7"]</code></li> 113 121
Note: See TracChangeset
for help on using the changeset viewer.