WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Post Editor Buttons Fork

This plugin allows you add your own buttons to the post editor's HTML mode toolbar.

I don't see the buttons I've created. Where are they?

This plugin creates buttons for the HTML editor only.

Can I put classes/styles or other attributes inside the tag?

Yes, but you must use single quotes. For example, this will work:

<h2 style='color:#ff0;'>

But this will not:

<h3 class="clear">

As of version 2.1, " will be replaced with ' automatically
As of version 2.3, quote marks should be preserved

Why are my inline styles are being removed?

Some styles are removed by WordPress while others aren't. For example, this will work:

<span style='color:red;'>

But this will not:

<span style='display:none;'>

These styles are being removed when the provided tags are passed through one of WordPress's sanitation filters. I'm currently investigating the best way to get around this.

Why isn't this tag/attribute being saved?

When you save a custom button, the before/after pieces are filtered. No point in creating a button that adds something that'll only be removed when you save a post, right?

To allow additional tags, you'll need to add some code. (I recommend add it to your functions.php file so it will be preserved if you update the plugin).

Here's how to allow the video tag

add_filter( 'admin_init', 'allowed_tags' );
function allowed_tags() {
    global $allowedposttags;
    $allowedposttags['video'] = array();
}

To add more attributes (in this case, src, type, poster):

add_filter( 'admin_init', 'allowed_tags' );
function allowed_tags() {
global $allowedposttags;
    $allowedposttags['video']['src'] = array();
    $allowedposttags['video']['type'] = array();
    $allowedposttags['video']['poster'] = array();
}

Requires: 3.3 or higher
Compatible up to: 3.5.2
Last Updated: 2012-12-19
Downloads: 5,972

Ratings

4 stars
4.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
25,4,1
0,1,0
50,2,1 100,8,8 100,1,1
100,1,1 100,2,2
100,2,2
100,1,1
100,3,3
100,1,1