Themple Helper is the first bundled plugin of the Themple Starter package. Currently it gives you a shortcode that makes it possible to display the values of your options wherever you’d like to in your pages and posts.
However, before we take a look into this small plugin, let’s see why it is bundled as a ZIP file and not part of the Starter theme’s core…
About bundled plugins
Bundled plugins are a bit controversial field if we talk about WordPress themes. While the official wordpress.org theme repository’s rules say that a theme shouldn’t have any plugins bundled with itself, premium theme repositories like ThemeForest are not that strict in this question.
The debate over bundled plugins can happen because of 2 different approaches:
- WordPress.org says that a theme should only be responsible for displaying content and all extra functionality should be added via plugins. If you bundle plugins with your theme then it’s like adding the extra functionality in a ZIP file alongside your theme files.
- ThemeForest’s approach is that a premium theme should give the best possible value to the end user. And sometimes to reach this goal theme authors need to add extra functionality with the help of bundled plugins.
There is no problem if you want to make your theme add plugins from WP Plugin repository or your own private repo using the TGM Plugin Activation library – simply because your theme doesn’t include the plugin’s ZIP file.
The problem is there when you’re adding a premium (non-free) plugin as a bundled plugin to your theme. Then usually the only possible solution to do so is bundling it in a ZIP file.
Why is it bundled instead of being part of the framework’s core?
Themple Helper is a very small plugin which was bundled as a ZIP file into the Themple Starter package,mainly because of the following reasons:
- it adds features to the Themple Framework that are in the plugins territory (shortcodes)
- it gives you an example on how to bundle a plugin into your theme
- it can’t work without Themple Framework, so it wouldn’t have been a good idea to upload to the WP Plugin repository or to keep it separately in any other way
What does it do?
Currently (in v1.1), it has one shortcode only: [ tpl-var ]
With the tpl-var shortcode you can add values of options into your posts and pages.
Plus, you can use some other attributes too for specific data types. You can use the same parameters as for the
tpl_value() function – and in fact, the shortcode outputs the same content as the
tpl_value() function. E.g. for an image type option, you can have lot of attributes:
[tpl-var name="tpl_logo" size="medium" class="my_image_class" alt="My alternative text"]
For a full list about the possible attributes, read these pages:
In the future we’re planning to add other useful shortcodes, like tabbed layout, accordions, optionally custom post types for the most common uses, too. However, any ideas are welcome 🙂