TinyMCE - Mostrar opciones avanzadas (2da fila) de forma predeterminada

2

Así que he personalizado mi tinyMCE un poco para agregar algunos botones y reorganizar algunas cosas:

function myformatTinyMCE($in)
{
    $in['theme_advanced_buttons1']='bold,italic,underline,bullist,numlist,hr,blockquote,link,unlink,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent';
    $in['theme_advanced_buttons2']='formatselect,pastetext,pasteword,charmap,undo,redo';
    return $in; 
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );

Pensé que al no agregar wp_adv al final de la primera lista de botones, la segunda fila se mostraría por defecto, pero este no es el caso, simplemente pierdo la segunda fila por completo. Quiero mostrar la segunda fila, siempre, sin presionar ni mostrar el botón wp_adv .

¿Cómo puedo mostrar una segunda fila en mi TinyMCE de forma predeterminada?

    
pregunta Howdy_McGee 10.10.2013 - 15:59

1 respuesta

4

Si inspecciona el valor de $in , debería obtener algo como:

Array
(
    [mode] => exact
    [width] => 100%
    [theme] => advanced
    [skin] => wp_theme
    [language] => en
    [theme_advanced_toolbar_location] => top
    [theme_advanced_toolbar_align] => left
    [theme_advanced_statusbar_location] => bottom
    [theme_advanced_resizing] => 1
    [theme_advanced_resize_horizontal] => 
    [dialog_type] => modal
    [formats] => {
                        alignleft : [
                            {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
                            {selector : 'img,table', classes : 'alignleft'}
                        ],
                        aligncenter : [
                            {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
                            {selector : 'img,table', classes : 'aligncenter'}
                        ],
                        alignright : [
                            {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
                            {selector : 'img,table', classes : 'alignright'}
                        ],
                        strikethrough : {inline : 'del'}
                    }
    [relative_urls] => 
    [remove_script_host] => 
    [convert_urls] => 
    [remove_linebreaks] => 1
    [gecko_spellcheck] => 1
    [fix_list_elements] => 1
    [keep_styles] => 
    [entities] => 38,amp,60,lt,62,gt
    [accessibility_focus] => 1
    [media_strict] => 
    [paste_remove_styles] => 1
    [paste_remove_spans] => 1
    [paste_strip_class_attributes] => all
    [paste_text_use_dialog] => 1
    [webkit_fake_resize] => 
    [preview_styles] => font-family font-weight text-decoration text-transform
    [schema] => html5
    [wpeditimage_disable_captions] => 
    [wp_fullscreen_content_css] => http://example.com/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css
    [plugins] => inlinepopups,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen
    [content_css] => http://example.com/wp-content/themes/twentytwelve/editor-style.css,http://fonts.googleapis.com/css?family=Open+Sans:400italic%2C700italic%2C400%2C700&subset=latin%2Clatin-ext
    [elements] => content
    [wpautop] => 1
    [apply_source_formatting] => 
    [theme_advanced_buttons1] => bold,italic,strikethrough,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,wp_more,spellchecker,wp_fullscreen,wp_adv
    [theme_advanced_buttons2] => formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,undo,redo,wp_help
    [theme_advanced_buttons3] => 
    [theme_advanced_buttons4] => 
    [tabfocus_elements] => insert-media-button,save-post
    [body_class] => content post-type-post post-status-publish post-format-standard
    [theme_advanced_resizing_use_cookie] => 
    [wordpress_adv_hidden] => 
)

El último elemento wordpress_adv_hidden le ofrece la posibilidad de ocultar / mostrar el fregadero de la cocina

/***ModifyTinyMCE**@paramarray$in*@returnarray$in*/functionmy_tiny_mce_before_init($in){//customizethebuttons$in['theme_advanced_buttons1']='bold,italic,underline,bullist,numlist,hr,blockquote,link,unlink,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent';$in['theme_advanced_buttons2']='formatselect,pastetext,pasteword,charmap,undo,redo';//Debug://print_r($in);//exit();//Keepthe"kitchen sink" open:   
    $in[ 'wordpress_adv_hidden' ] = FALSE;

    return $in;
}
add_filter( 'tiny_mce_before_init', 'my_tiny_mce_before_init' );
    
respondido por el birgire 10.10.2013 - 18:53

Lea otras preguntas en las etiquetas