WP Manifestindependent plugin directory

vars #10 in Utilities

With vars (a plugin for classicPress) you can define name-value associations from the admin.

by Gieffe edizioni srl · github.com/xxsimoxx/vars · website

1stars
382release downloads
≈40active sites
1forks

Install

The author publishes release zips, so WP-CLI can install straight from GitHub:

wp plugin install https://github.com/xxsimoxx/vars/releases/download/v2.1.2/vars-v2.1.2.zip

Readme

vars

With vars you can define name-value associations from the admin.

Then, in your content you can insert [vars]name[/vars] and get value displayed.

Useful if you have a value (a phone number, number of employees) in several pages that can change, so you can change this once from the admin.

It integrates into TinyMCE by adding a menu (compatible also with TinyMCE v.5).

You can choose which users can manage vars.

Look at the screenshots.

Shortcodes everywhere

There is also an option (that affects every shortcode in your site) to display shortcodes in areas where normally they are not.

  • single_post_title
  • the_title
  • widget_text
  • widget_title
  • bloginfo
  • get_post_metadata

Integration

Security menu

If running ClassicPress 1.1.0 or newer those settings are moved to the Security menu: choose which users can manage vars, what to do with vars when uninstalling and apply shortcodes everywhere

Functions

If you would like to use in your theme/plugin vars_do('name') and get value displayed.

Filters

There is a filter called vars_output

An example to capitalize the output.

function vars_output_upper( $string ) {
    return strtoupper( $string );
}
add_filter( 'vars_output', 'vars_output_upper' );

An example to use it to exec PHP code. Dangerous, don't do it. You have to open and close php tags in your string.

function vars_output_exec_php( $string ) {
    ob_start();
    eval( "?>" . $string ." " );
    $evalContent = ob_get_contents();
    ob_end_clean();
    return $evalContent;
}
add_filter( 'vars_output', 'vars_output_exec_php' );

Screenshots

Editing vars

TinyMCE button

Security settings

Privacy

To help us know the number of active installations of this plugin, we collect and store anonymized data when the plugin check in for updates. The date and unique plugin identifier are stored as plain text and the requesting URL is stored as a non-reversible hashed value. This data is stored for up to 28 days.

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
v2.1.2 Dec 3, 2024 vars-v2.1.2.zip 58
2.1.1 Aug 31, 2022 vars-2.1.1.zip 159
2.1.0 Nov 19, 2021 vars-2.1.0.zip 65
v2.0.3 Mar 13, 2020 vars.zip 39
v2.0.2 Mar 9, 2020 vars.zip 5
v2.0.1 Jan 27, 2020 vars.zip 9
v2.0.0 Jan 9, 2020 vars.zip 8
v1.3.4 Dec 30, 2019 vars.zip 11
v1.3.3 Dec 23, 2019 vars.zip 9
v1.3.2 Nov 20, 2019 vars.zip 9
v1.3.1-dev1 Nov 19, 2019 vars.zip 10
v1.3.0 Oct 29, 2019
v1.2.4 Oct 28, 2019
v1.2.3 Oct 13, 2019
v1.2.2 Oct 11, 2019
v1.2.1 Sep 25, 2019
v1.2.0 Sep 23, 2019
v1.1.2 Aug 30, 2019
v1.1.0 Aug 26, 2019
1.0.1 Aug 26, 2019

Active-site estimate ≈40 comes from the median of recent superseded releases. Method.