Posted By

travishines on 11/26/11


Tagged

wordpress text alert admin Microsoft word notice copied


Versions (?)

Anti-Word Alert


 / Published in: PHP
 

I've yet to work on a WordPress site where at least once post wasn't copied from Microsoft Word, producing a mess of inline tags and awful markup.

This helps prevent that, just a little.

  1. add_action( 'admin_notices', 'custom_admin_notice' );
  2. function custom_admin_notice(){
  3. global $current_screen;
  4. if ( $current_screen->parent_base == 'edit' )
  5. echo '<div class="updated"><p><strong>NOTE</strong> - Please do not copy and paste text from Microsoft Word. You can write and save your post here in WordPress, or copy it from a plain text app (Notepad or TextEdit). Microsoft Word adds a ton of messy inline tags that break things.</p></div>';
  6. }

Report this snippet  

You need to login to post a comment.