English Czech

WordPress Quicktags Guide – Make editing your WordPress Weblog even easier. Quicktags are those useful one-click buttons that insert code for you, now the good news is that you can add to this quicktags list should you use a lot of tags that are not already there, and here is how.

How to add your button to WordPress Editor

How to add your button to WordPress Editor

Since version 2.0, see quicktags.js file in the /wp-includes/js/. Right-click to open the file in Notepad, PcPad.

Right at the beginning of the file you see

function edButton(id, display, tagStart, tagEnd, access, open) {
this.id = id; // used to name the toolbar button
this.display = display; // label on button
this.tagStart = tagStart; // open tag
this.tagEnd = tagEnd; // close tag
this.access = access; // access key
this.open = open; // set to -1 if tag does not need to be closed
}

Everything you need to create another button you will see in the following definition gradually fill the name of the button, opening and closing tag (if it is a paired tag), enter that key in use Alt will pay as a shortcut.

edButtons[edButtons.length] = new edButton('ed_strong'
,'strong'
,'<strong>'
,'</strong>'
,'b'
);

David

Graphic and website designer, currently, I attend to the maintenance of about thirty sites for existing clients as well as creating websites for the new ones. In my free time, I get into the secrets of the world of Linux, SSH, WP-CLI and I’m preparing this blog.

Pin It on Pinterest

Shares