Text Justify Buttons Missing – 3.9 with Custom functions.php
-
Hello!
I just updated my site to 3.9, and haven’t noticed any issues EXCEPT that the ‘justifyleft’, ‘justifyright’, and ‘center’ buttons are missing from the visual editor. I have edited the functions.php file (see below), but ALL of the buttons I have specified within the functions file are still available — the only buttons missing are the 3 justification buttons.
I have tried re-uploading the file, and I also switched to the Twenty-Fourteen theme, which DID return the buttons. However, I’m flummoxed as to why only the alignment buttons are the only buttons affected.
Any help or advice is greatly appreciated!
-Phil
// TinyMCE: First line toolbar customizations if( !function_exists('base_extended_editor_mce_buttons') ){ function base_extended_editor_mce_buttons($buttons) { // The settings are returned in this array. Customize to suite your needs. return array( 'pastetext', 'formatselect', 'separator', 'bold', 'italic', 'underline', 'separator', 'bullist', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'separator', 'spellchecker', 'fullscreen', 'wp_adv' ); } add_filter("mce_buttons", "base_extended_editor_mce_buttons", 0); } // TinyMCE: Second line toolbar customizations if( !function_exists('base_extended_editor_mce_buttons_2') ){ function base_extended_editor_mce_buttons_2($buttons) { // The settings are returned in this array. Customize to suite your needs. An empty array is used here because I remove the second row of icons. return array( 'removeformat', 'separator', 'outdent', 'indent', 'separator', 'undo', 'redo', 'wp_help' ); } add_filter("mce_buttons_2", "base_extended_editor_mce_buttons_2", 0); } // Customize the format dropdown items if( !function_exists('base_custom_mce_format') ){ function base_custom_mce_format($init) { // Add block format elements you want to show in dropdown $init['theme_advanced_blockformats'] = 'p,h2,h3,div'; // Add elements not included in standard tinyMCE dropdown p,h1,h2,h3,h4,h5,h6 //$init['extended_valid_elements'] = 'code[*]'; return $init; } add_filter('tiny_mce_before_init', 'base_custom_mce_format' ); } function enable_more_buttons($buttons) { // $buttons[] = 'hr'; return $buttons; } add_filter("mce_buttons", "enable_more_buttons"); // Add CSS to Visual Editor add_editor_style('css/custom-editor-style.css'); // Add body class to Visual Editor to match class used live function mytheme_mce_settings( $initArray ){ $initArray['body_class'] = 'post'; return $initArray; } add_filter( 'tiny_mce_before_init', 'mytheme_mce_settings' ); // Add styles to Kitchen Sink add_filter( 'mce_buttons_2', 'my_mce_buttons_2' ); function my_mce_buttons_2( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } add_filter( 'tiny_mce_before_init', 'my_mce_before_init' ); function my_mce_before_init( $settings ) { $style_formats = array( array( 'title' => 'Small', 'selector' => 'p, h3', 'classes' => 'small' ), array( 'title' => 'Medium', 'selector' => 'p, h3', 'classes' => 'medium' ), array( 'title' => 'Large', 'selector' => 'p, h3', 'classes' => 'large' ), array( 'title' => 'Signature', 'selector' => 'p', 'classes' => 'signature' ), ); $settings['style_formats'] = json_encode( $style_formats ); return $settings; } // Styling is now visible in the Visual Editor add_action( 'admin_init', 'add_my_editor_style' ); function add_my_editor_style() { add_editor_style(); }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Text Justify Buttons Missing – 3.9 with Custom functions.php’ is closed to new replies.