UPDATE: More details will be coming soon. I need to finish the documentation.

Contributors: fightthecurrent
Donate link: http://bit.ly/QhXuBc
Tags: shortcodes, theme, generator
Requires at least: 3.0
Tested up to: 3.4.2
Stable tag: 1.0

A plugin to generate shortcodes and a corresponding button in the WordPress visual editor. Wicked!

Description

Adding shortcodes to the Visual Editor can be a pain in the buttocks. Not anymore. Now, you can add shortcodes and a button to the editor as simply as using an array and this plugin. How neat is that?

Note: This plugin requires at LEAST PHP 5.3. If you’re not sure what version of PHP you’re using, consult your host.

Button Text

Credits

Some icons by Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 License.

Installation

1. Upload shortcodes-generator.zip to the /wp-content/plugins/ directory and unzip it
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Drag the shortcodes folder inside shortcodes-generator to the root of your theme
4. Create your shortcode via arrays. For more details, check out the FAQ, or visit [the plugin site.](http://fightthecurrent.org/plugins/shortcodes-generator)
5. That’s it! Enjoy!

Frequently Asked Questions

So how do I add the shortcodes, anyway?

Well, after you’ve moved the shortcodes folder to your theme, open up shortcodes/array.php. The simplest one you can make would look like this:

$shortcodes['button'] = array(
'shortcode' => 'button'
);

That would create a shortcode that looks like this: Button Text

If you want to define some default parameters, just change params to this:

'params' => array(
'class' => 'small',
'color' => 'green'
)

It will produce this output:

Button Text

Want to be able to select text and have the shortcode wrap around it? Just pass 'selectable' => 1.

I will eventually add a ThickBox dialogue so that people can have default selections picked out for them, and actually have more of a UI. But this will do for now.

Changelog

1.0

* Initial Release

Button Text

Fork me on GitHub

2 Comments

  1. Shortcodes Generator | Really cool wordpress theme | wordpressyeah.com
    September 22, 2012

    [...] You can check out more details on how to use the plugin, please visit the plugin site. [...]

    Reply
  2. Tomáš Kapler
    September 23, 2012

    This plugin is exactly the think i wanted to create several times but i haven’t got time to. Actually i think, that this should be part of core, WP still got easy function to only put button to non-wysiwyg editor, as it was few years ago when WP did not have wysiwyg at all.
    Just IMO the installation is not for 99,99% users a d the same for button creation. I wonder that there may be some very easy form with all the fields, which would simply generate code to be inserted to user’s functions.php.

    Reply

Leave a Reply