WordPress.org

Forums

Hiding/Removing Quicktags in HTML Editor (1 post)

  1. Adam Capriola
    Member
    Posted 4 years ago #

    I just wanted to see if there is any better way than this to remove/hide quicktags from the HTML editor:

    // Hide Quicktags
    add_action('admin_head','hide_quicktags');
    function hide_quicktags() {
      if ( (preg_match ('#wp-admin/post-new.php(.*)$#',$_SERVER['REQUEST_URI'])) || (preg_match ('#wp-admin/post.php(.*)$#',$_SERVER['REQUEST_URI'])) ) {
      ?>
      <style type="text/css">
      #ed_ins, #ed_img, #ed_more, #ed_spell, #ed_code, #ed_close, #ed_poll, #ed_del, #ed_ul, #ed_ol, #ed_li, #ed_block {display:none !important;}
      </style>
      <?php
      }
    }

    I've got that in my theme's functions.php file... I hate using CSS to hide things, but I can't figure out if there is a remove_filter() function I can use to remove things.

    And editing quicktags.js is out of the question... I'd rather not touch core files if it's not necessary.

    Thanks for any alternative insights!!

Topic Closed

This topic has been closed to new replies.

About this Topic