Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /************************
- * Clean up shortcode
- ***********************/
- function jeg_clean_shortcodes($content) {
- $array = array (
- '<p>[' => '[',
- ']</p>' => ']',
- ']<br />' => ']'
- );
- $content = strtr($content, $array);
- return $content;
- }
- add_filter('the_content', 'jeg_clean_shortcodes');
- /* Plugin Name: My TinyMCE Buttons */
- add_action( 'admin_init', 'jeg_tinymce_button' );
- function jeg_tinymce_button() {
- if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
- add_filter( 'mce_external_plugins', 'jeg_add_tinymce_button' );
- }
- }
- function jeg_add_tinymce_button( $plugin_array ) {
- $plugin_array['jcode'] = get_template_directory_uri() . "/assets/tinymce/jcode.js" ;
- return $plugin_array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement