[WordPress] 外掛分享: Calculate Values with Shortcodes

前言介紹

  • 這款 WordPress 外掛「Calculate Values with Shortcodes」是 2018-05-24 上架。
  • 目前有 300 個安裝啟用數。
  • 上一次更新是 2020-05-20,距離現在已有 1810 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.2.4 以上。
  • 有 9 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

bhagwad |

外掛標籤

evaluation | shortcodes | calculated fields |

內容簡介

您是否曾想要動態地計算一些數值,以顯示在您的文章中?假設您有一些簡碼(shortcode),可以即時從資料庫檢索數值。現在,您想要對這些簡碼進行一些計算,並在您的文章或頁面中顯示結果。這款外掛允許您使用簡單的 [calculate] 簡碼,加上數學運算式,以即時顯示這些數值!

因此,像 [calculate]2+3*4[/calculate] 這樣的數學運算式將返回值 “14”。現在,只需將任何數值替換為返回數字的簡碼,您就可以完成設置。

屬性

您可以使用 “dec” 屬性來指定您要將結果四捨五入到多少位小數。默認值為 “0”。這意味著,默認情況下,所有結果都會四捨五入為整數。

為了進行國際化的數字格式化,您可以使用 “int” 屬性來指定區域設置。例如,int=”fr_FR” 將根據法國區域設置格式化數字!

有關演示,請參閱屏幕截圖。

例如,您可以使用此功能來顯示正在不斷變化的表格中的值。或者參考動態價格乘以一些值。此外,您可以在這裡看到此外掛在真實網站上的應用實例。

最好的部分是,它不使用 “eval” 等危險的函數,因此所有作者都可以安全地使用它。它不會對您的網站造成破壞。

原文外掛簡介

Have you ever wanted to calculate some values dynamically to display in your posts? Let’s say you have some shortcodes that retrieve values in real time from the database. Now you want to perform some calculations on those shortcodes and display the results in your posts or pages. This plugin allows you to use a simple [calculate] shortcode with the expression inside to display these values in real time!
So an expression like [calculate]2+3*4[/calculate] will return the value “14”. Now just replace any numeric value with a shortcode that returns a number and you’re set.
Attributes
You can use the “dec” attribute to specify the number of decimal digits you want to round the result up to. The default is “0”. Meaning that by default, all results will be rounded to an integer.
For international number formatting, you can use the “int” attribute to specify a locale. For example, int=”fr_FR” will format the numbers according to the french locale!
See screenshots for illustrations.
For example, you can use this to display values in a table that are constantly changing. Or refer to dynamic prices multiplied by some value. The possibilities are endless.
You can see a real world example of this plugin at work here:
The best part is, it doesn’t use dangerous functions like “eval” to work – which means all authors can use it safely. There’s no danger of it breaking your site.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Calculate Values with Shortcodes」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.0 | 2.2 |

延伸相關外掛(你可能也想知道)

  • AIO Forms – Craft Complex Forms Easily 》, 想看一些演示或嘗試插件而不實際安裝它嗎?點此, , , 特色, 您想創建一個高級表單,例如:, * 訂單表單, * 活動登記, * 計算機, * 用戶註冊, * 報價單表單,...。
  • Easy Calculation Forms 》">Demo), File Upload: Allow users to upload files (Demo), Date Picker: Allow users to select a date (Demo), Time Picker: Allow users to select a ti...。

文章
Filter
Apply Filters
Mastodon