Sitemizde kod renklendirme de kullanmış olduğumuz Syntax Highlighter Evolved eklentisini bir çoğunuz biliyordur. Ancak bu eklentinin sadece yazı içerisinde çalıştığı belki çok az kişinin dikkatini çekmiştir. Durum budur, eklenti yorumlarda verilen kodları renklendirmemektedir.

Yapmanız Gerekenler

  1. syntaxhighlighter.php dosyasını açınız. (2.2.0 sürümü)
  2. 76. satıra ilerleyiniz. Şu kodları göreceksiniz:
    // Register hooks
    add_action( 'admin_menu', array(&$this, 'register_settings_page') );
    add_action( 'admin_post_syntaxhighlighter', array(&$this, 'save_settings') );
    add_action( 'admin_head', array(&$this, 'admin_head') );
    add_action( 'wp_head', array(&$this, 'frontend_styling') );
    add_action( 'wp_footer', array(&$this, 'maybe_output_scripts'), 15 );
    add_filter( 'the_content', array(&$this, 'parse_shortcodes'), 9 );
    add_filter( 'widget_text', array(&$this, 'parse_shortcodes'), 9 );
    add_filter( 'mce_external_plugins', array(&$this, 'add_tinymce_plugin') );
    add_filter( 'tiny_mce_version', array(&$this, 'break_tinymce_cache') );
    add_filter( 'the_editor_content', array(&$this, 'decode_shortcode_contents'), 1 );
    add_filter( 'content_save_pre', array(&$this, 'encode_shortcode_contents'), 1 );
    add_filter( 'save_post', array(&$this, 'mark_as_encoded'), 10, 2 );
    add_filter( 'plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2 );
  3. Bu kodların altına veya üzerine şu kodu ekleyiniz:
    add_filter( 'comment_text', array(&$this, 'parse_shortcodes'), 10);
  4. Dosyayı kaydedin ve kapatın.

Bundan sonra yorumlarda, yazılarda olduğu gibi kod renklendirmesi yapabileceksiniz 🙂