WordPress plugin intelligence profile

Template Dictionary

A plugin for developers which provides template variables dictionary editable in backend.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.5
Current version1.6.1
WordPress coverageTested up to WordPress 5.5
Minimum stackWP 4.5 · PHP —
Directory statusactive
Last directory update16 Nov 20205y ago
Active installations10Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Template Dictionary version 1.6.1 as active, updated 5y ago and tested up to WordPress 5.5.

Overview

About this plugin

Template Dictionary is a plugin which can be used to create template variables editable by admins.

The plugin is multilingual ready. It includes Polylang integration, another multilingual plugin can be integrated with filters.

Admin pages

There are few admin pages for managing the plugin.

  • Template Dictionary – view, edit and delete the template variables values
  • Settings list – view, edit and delete template variables settings
  • Add setting – add new or edit template variables setting
  • Edit values – edit a value, this page is accessable from the page Template Dictionary
  • Export/Import – export settings and values to xml or import it from xml

Usage in template

You can use a value in template by calling function get of Template Dictionary object, which can be accessed by function TmplDict().

For example, if you set a setting with code the_code, you can use it’s value by:

TmplDict()->get( 'the_code' );

This function returns the value. If you need to echo the value, you can use function eget. Both functions have an optional argument $default, which is the default returned/echoed value, if the admin value is empty.

You can also get the value by accessing the code as property:

$value = TmplDict()->the_code;

Usage with shortcode

You can also use a shortcode [tmpl_dict] with attributes code, default and do_shortcode. The last attribute says, if the function do_shortcode will be called on the value.

Setup template language

Default template language can be set by setting the constant TMPL_DICT_DEFAULT_LANG in wp-config. Default value of this constant consists of two first characters of the current WP locale. It is important to set the default language constant properly if you plan to create your site multilingual in future.

If you have a multilingual site, you need to set current template language with the filter template_dictionary_language. For users of Polylang, it is already integrated in this plugin, the current template language is the Polylang current language slug.

Setup available languages

If you have a multilingual site, you also need to set available languages with the filter template_dictionary_languages. Again, if Polylang is activated, these available languages consist of Polylang languages slugs.

If your site is not multilingual, there is only one available language – the default language.

Use JS object

To generate JavaScript dictionary object, you need to define TMPL_DICT_JS_VAR_NAME constant. php:

define( 'TMPL_DICT_JS_VAR_NAME', 'dict' );

Then you can use it in JS:

the_code );

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • dictionary
  • options
  • settings
  • template
  • variables
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.5

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.5.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.5
Minimum requirementsWordPress 4.5 · PHP not listed
Update activity16 Nov 20205y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.