Skip to content

Instantly share code, notes, and snippets.

@joshuaiz
Created April 9, 2018 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaiz/c34ea009a51612ac33657cff704ad8e1 to your computer and use it in GitHub Desktop.
Save joshuaiz/c34ea009a51612ac33657cff704ad8e1 to your computer and use it in GitHub Desktop.
Add extra Quicktags to WordPress Content box
<?php
/*
* QUICKTAGS
*
* Let's add some extra Quicktags for clients who aren't HTML masters
* They are pretty handy for HTML masters too.
*
* Hook into the 'admin_print_footer_scripts' action
*
*/
add_action( 'admin_print_footer_scripts', 'plate_custom_quicktags' );
function plate_custom_quicktags() {
if ( wp_script_is( 'quicktags' ) ) { ?>
<script type="text/javascript">
QTags.addButton( 'qt-p', 'p', '<p>', '</p>', '', '', 1 );
QTags.addButton( 'qt-br', 'br', '<br>', '', '', '', 9 );
QTags.addButton( 'qt-span', 'span', '<span>', '</span>', '', '', 11 );
QTags.addButton( 'qt-h2', 'h2', '<h2>', '</h2>', '', '', 12 );
QTags.addButton( 'qt-h3', 'h3', '<h3>', '</h3>', '', '', 13 );
QTags.addButton( 'qt-h4', 'h4', '<h4>', '</h4>', '', '', 14 );
QTags.addButton( 'qt-h5', 'h5', '<h5>', '</h5>', '', '', 15 );
</script>
<?php }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment