Advertisement
helgatheviki

Multiple Instances of the WP Text Editor in Metaboxes

Mar 10th, 2011
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. function my_admin_print_footer_scripts() {
  2.     global $post; ?>
  3.  
  4.     <script type="text/javascript">
  5.    
  6.         /* <![CDATA[ */
  7.         jQuery.noConflict();
  8.         jQuery(document).ready(function($) {
  9.        
  10.             var i=1;
  11.             $('.customEditor textarea').each(function(e)
  12.             {
  13.                 var id = $(this).attr('id');
  14.  
  15.                 if (!id)
  16.                 {
  17.                     id = 'customEditor-' + i++;
  18.                     $(this).attr('id',id);
  19.                 }
  20.  
  21.                 tinyMCE.execCommand('mceAddControl', false, id);
  22.  
  23.             });    
  24.        
  25.    
  26.            
  27.        
  28.        
  29.         });
  30.        
  31.    
  32.     /* ]]> */
  33.     </script>
  34. <?php }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement