Descrizione
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.
Screenshot
Installazione
- Upload unit-switcher to the wp-content/plugins/ directory
- Activate the plugin through the Plugins menu in WordPress
- Visit the plugin settings to add units of measurement
- Use the unit_switcher() template function or [unit_switcher] shortcode to display the switcher
FAQ
- Is this plugin WPML compatible?
-
The plugin is not yet WPML compatible.
- How do I add a unit of measurement?
-
Visit Settings > Unit Switcher. A primary unit of measurement is required, along with at least one alternate unit. Substitute the primary unit with
X
in the formula to equal the alternate formula. So, to set an alternate unit ofinches
for a primary unit offeet
, the formula should be set toX*12
.
Recensioni
Non ci sono recensioni per questo plugin.
Contributi e sviluppo
“Units” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.
CollaboratoriTraduci “Units” nella tua lingua.
Ti interessa lo sviluppo?
Esplora il codice segui il repository SVN, segui il log delle modifiche tramite RSS.
Changelog
1.0.2
- Bug fix – conflict with Bootstrap Javascript libary resolved.
1.0.1
- Page caching conflicts resolved. If using a page cache plugin, visit Settings > Unit Switcher to enable the fix.
- Minor bug fixes in options saving
1.0
- Initial release