TinyMCE自定义按钮仅出现在“中”;“视觉”;模式。如何使它们出现在“中”;“文本”;模式也一样

TinyMCE自定义按钮仅出现在“中”;“视觉”;模式。如何使它们出现在“中”;“文本”;模式也一样,tinymce,Tinymce,下面的函数用于将自定义按钮添加到TinyMCE。在“视觉”模式下,按钮显示良好。然而,当我切换到“文本”模式时,我看不到它们 在下面的脚本中,我已经注释掉了过滤富_编辑模式的行。我错过了什么 function addbuttons() { global $page_handle; // Don't bother doing this stuff if the current user lacks permissions if ( !current_user_can('e

下面的函数用于将自定义按钮添加到TinyMCE。在“视觉”模式下,按钮显示良好。然而,当我切换到“文本”模式时,我看不到它们

在下面的脚本中,我已经注释掉了过滤富_编辑模式的行。我错过了什么

function addbuttons() {
    global $page_handle;

    // Don't bother doing this stuff if the current user lacks permissions
    if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') )
        return;

    // Add only in Rich Editor mode
    //if ( get_user_option('rich_editing') == 'true') {
        $svr_uri = $_SERVER['REQUEST_URI'];
        if ( strstr($svr_uri, 'post.php') || strstr($svr_uri, 'post-new.php') || strstr($svr_uri, 'page.php') || strstr($svr_uri, 'page-new.php') || strstr($svr_uri, $page_handle) ) {
            add_filter("mce_external_plugins", array (&$this, 'add_tinymce_plugin' ), 5);
            add_filter('mce_buttons', array (&$this, 'register_button' ), 5);
            add_filter('mce_external_languages', array (&$this, 'add_tinymce_langs_path'));
        }
    //}
}

function register_button($buttons) {
    array_push($buttons, 'separator', 'nextpage' , 'CustomCodes' );
    return $buttons;
}

function add_tinymce_plugin($plugin_array) {
    $plugin_array['CustomCodes'] =  $this->path . 'plugins/custom/editor_plugin_src.js';
    return $plugin_array;
}


function add_tinymce_langs_path($plugin_array) {
    // Load the TinyMCE language file
    $plugin_array[$this->pluginname] = CB_ADMIN . '/tinymce/langs.php';
    return $plugin_array;
}

你在用wordpress吗?