
內容簡介
為什麼使用Units?
Units 提供使用者直覺的方式選擇和顯示他們喜愛的度量單位。 使用者喜愛的度量單位可透過會話、Cookie 或不使用儲存,可在外掛程式設定中進行組態。
主要/替代單位可添加許多個,並附有其轉換公式。
請造訪 unitswitcher.com 以取得更詳細的資訊。
使用 Units
在「設定」>「Units」下添加主要單位。通過提供其名稱和轉換公式,也可添加替代單位。可為每個主要單位添加多個替代單位。
在範本中使用函數 unit_switcher($value, $primaryunit, $round) 以顯示交換機。將儲存的值作為第一個參數,將主要度量單位作為第二個值傳遞。
要顯示單個轉換器,可使用短碼[ unit_switcher ]。短碼需要兩個參數:單位(要轉換的主要單位)和值(儲存的值)。
有關更多資訊,請造訪 unitswitcher.com。
重要提示:需要 WordPress 版本 3.8 或更高版本和 PHP 版本 5.3.2 或更高版本。
更多資訊
使用模板函數
unit_switcher($variable, $primaryunit, $round);
參數: < br />< br />
* $variable-儲存的值(整數或浮點數)< br />< br />
* $primaryunit-主要的度量單位(將儲存的值存儲在此單位中)< br />< br />
* $round-要四捨五入的位數(默認值為 2)
請造訪 unitswitcher.com 取得更詳細的資訊。
外掛標籤
開發者團隊
原文外掛簡介
Why Units?
Units provides your users with an intuitive way to choose and display their preferred unit of measurement. The user’s preferred unit of measurement is saved via session, cookie, or none – configurable under the plugin settings.
Any number of primary/alternate units can be added, along with their conversion formulas.
Visit unitswitcher.com for more detailed information.
Using Units
Add primary units under Settings > Units. Alternate units may be added by providing their name and conversion formula. Multiple alternate units may be added for each primary unit.
Use the function unit_switcher($value, $primaryunit, $round) in your template to display the switcher. Pass the stored value as the first parameter and primary unit of measurement as the second value.
To display a single switcher, the shortcode [unit_switcher] is available for use. The shortcode requires two parameters: unit (the primary unit being converted) and value (the stored value).
For more information visit unitswitcher.com.
Important: Unit Switcher requires WordPress version 3.8 or higher, and PHP version 5.3.2 or higher.
More Information
Using the Template Function
unit_switcher($variable, $primaryunit, $round);
Parameters:
* $variable – The stored value (integer or float)
* $primaryunit – The primary unit (the stored value should be stored in this unit)
* $round – Number of digits to round to (default is 2)
Visit unitswitcher.com for more detailed information.
