Created
July 6, 2015 13:47
-
-
Save lmm214/c404c944287e1d7d77ff to your computer and use it in GitHub Desktop.
发布文章添加编辑器按钮
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_add_quicktags() { | |
if (wp_script_is('quicktags')){ ?> | |
<script type="text/javascript"> | |
//QTags.addButton( id, display, arg1, arg2, access_key, title, priority, instance ); | |
QTags.addButton( 'pre.html4', 'HTML代码', "\n<pre lang='html4strict'>\n", "\n</pre>\n" ); | |
QTags.addButton( 'pre.js', 'JS代码', "\n<pre lang='javascript'>\n", "\n</pre>\n" ); | |
QTags.addButton( 'pre.php', 'PHP代码', "\n<pre lang='php'>\n", "\n</pre>\n" ); | |
QTags.addButton( '[gallery.i2m]', '两列', '\n[gallery link="file" include="," columns="2" size="medium"]\n','' ); | |
QTags.addButton( '[gallery.i3m]', '三列', '\n[gallery link="file" include="," size="medium"]\n','' ); | |
</script> | |
<?php } | |
} | |
add_action( 'admin_print_footer_scripts', 'my_add_quicktags' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment