WordPress.org

Ready to get started?Download WordPress

Forums

WP TinyMCE Excerpt
Bug fix: making sure it doesn't kill "Custom Fields" plu (2 posts)

  1. bivald
    Member
    Posted 1 year ago #

    Certain admin pages, such as the popular plugin "custom fields" doesn't have TinyMCE defined, and still runs the admin_hear-post actions (giving an error, halting the plugin). Fix, wrap it in try/catch:

    function tinymce_excerpt() {
    jQuery("#excerpt").addClass("mceEditor");
    try {
    tinyMCE.execCommand("mceAddControl", false, "excerpt");
    tinyMCE.onAddEditor.add(function(mgr,ed) {
    if(ed.id=="excerpt"){
    ed.settings.theme_advanced_buttons2 ="";
    ed.settings.theme_advanced_buttons1 = "bold,italic,underline,seperator,justifyleft,justifycenter,justifyright,separator,link,unlink,seperator,pastetext,pasteword,removeformat,seperator,undo,redo,seperator,spellchecker,";
    }
    });
    }catch() {
    // ignore
    }
    }

    http://wordpress.org/extend/plugins/wp-tinymce-excerpt/

  2. bivald
    Member
    Posted 1 year ago #

    And of course, I mean }catch(e) {

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.