Advertisement
jegtheme

additional-shortcode.php

Jul 1st, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. /************************
  4.  * Clean up shortcode
  5.  ***********************/
  6.  
  7. function jeg_clean_shortcodes($content) {
  8.     $array = array (
  9.         '<p>[' => '[',
  10.         ']</p>' => ']',
  11.         ']<br />' => ']'
  12.     );
  13.     $content = strtr($content, $array);
  14.     return $content;
  15. }
  16.  
  17. add_filter('the_content', 'jeg_clean_shortcodes');
  18.  
  19. /* Plugin Name: My TinyMCE Buttons */
  20. add_action( 'admin_init', 'jeg_tinymce_button' );
  21.  
  22. function jeg_tinymce_button() {
  23.     if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
  24.         add_filter( 'mce_external_plugins', 'jeg_add_tinymce_button' );
  25.     }
  26. }
  27.  
  28. function jeg_add_tinymce_button( $plugin_array ) {
  29.     $plugin_array['jcode'] = get_template_directory_uri() . "/assets/tinymce/jcode.js"  ;
  30.     return $plugin_array;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement