Skip to content
WordPress plugin for changing measurement units on the fly
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
assets
languages
.gitignore
composer.json
gulpfile.js
package.json
readme.md
readme.txt
units.php

readme.md

Units for WordPress

Overview

Units provides your users with a way to choose and display their preferred unit of measurement on the fly. 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.

WordPress Repository

Demo

View the Demo

Installation

  1. Upload the units directory to wp-content/plugins/
  2. Activate the plugin through the Plugins menu in WordPress
  3. Visit the plugin settings to add units of measurement
  4. Use the unit_switcher() template function or [unit_switcher] shortcode to display the switcher

Usage

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).

You can’t perform that action at this time.