Skip to content

Instantly share code, notes, and snippets.

@AnatoliyAkhmatov
Created February 26, 2017 08:12
Show Gist options
  • Save AnatoliyAkhmatov/f0864556e94656490ccfa183225d1ccf to your computer and use it in GitHub Desktop.
Save AnatoliyAkhmatov/f0864556e94656490ccfa183225d1ccf to your computer and use it in GitHub Desktop.
function add_editor_button() {
if ( ! wp_script_is('quicktags') )
return;
?>
<script type="text/javascript">
QTags.addButton( 'eg_h3', 'h3', '<h3>', '</h3>', 'h', 'Заголовок h3', 1 );
QTags.addButton( 'eg_hr', 'hr', '<hr />', '', 'h', 'Горизонтальная линия', 201 );
QTags.addButton( 'eg_pre', 'pre', '<pre lang="php">', '</pre>', 'q', 'Подсветка PHP синтаксиса', 111 );
</script>
<?php
}
add_action( 'admin_print_footer_scripts', 'add_editor_button' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment