Home>Support>SiteOrigin Editor missing Formats and Editor Styles with WordPress v4.8 update

SiteOrigin Editor missing Formats and Editor Styles with WordPress v4.8 update

Hello,

First, thanks so much for creating such a great, free plugin. It has been very useful to our organization.

Today, we noticed after updating to WordPress v4.8 that the SiteOrigin Editor displays a blank drop down for custom formats and does not include our custom editor stylesheet. However, within the WordPress visual editor on a page or post, both the formats drop down and the custom editor stylesheet are working properly. I know that these issue have to do with how WordPress has recently changed the Editor API.

What is the estimated time before SiteOrigin will update their editor to work with the updated Editor API?

Thanks in advance for your assistance.

Best,
Rachel

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Rachel,

    We’ve actually already updated the SiteOrigin Editor widget (and related usage of the TinyMCE fields) to make use of the new Editor API and that is why this issue and related issues have been happening recently.

    The custom editor stylesheet should be working as of SiteOrigin Widgets Bundle, 1.9.7. Regarding the formats drop down, is that added by custom code or are you referring to the presentation drop down? If it’s the latter, that should be resolved in 1.9.6. If it’s the former, can you please send me a copy of the code you’re using to add the custom formatting drop down so I take a look over it?

  2. 6 years, 10 months ago Rachel

    Hi Alex,

    Sorry for such a late reply. It is working now and the 1.9.8 – 21 August 2017 version seems to have contained the fix for our custom code for additional TinyMCE formats:
    TinyMCE field: Check if individual TinyMCE settings are encoded as JSON and decode before re-encoding all settings.

    Or it was the 1.9.10 – 14 September 2017 version update:
    TinyMCE field: fixed issue with filter for TinyMCE plugins.

    Thanks for making the updates!!!

    This is the code we have to create the additional TinyMCE formats, following this tutorial:

    /*
    * Callback function to filter the MCE settings
    */
    
    function my_mce_before_init_insert_formats( $init_array ) {  
    
    // Define the style_formats array
    
    	$style_formats = array(  
    		// Each array child is a format with it's own settings
    		array(  
    			'title' => 'Button',  
    			'selector' => 'a',  
    			'classes' => 'btn',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Uppercase Button',  
    			'selector' => 'a',  
    			'classes' => 'btn uppercase',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Full-Width Button',
    			'selector' => 'a',  
    			'classes' => 'btn btn-full-width',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Red Button',  
    			'selector' => 'a',  
    			'classes' => 'btn-primary',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Uppercase Red Button',  
    			'selector' => 'a',  
    			'classes' => 'btn-primary uppercase',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Full-Width Red Button',
    			'selector' => 'a',  
    			'classes' => 'btn-primary btn-full-width',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Gray Button',  
    			'selector' => 'a',  
    			'classes' => 'btn-secondary',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Uppercase Gray Button',  
    			'selector' => 'a',  
    			'classes' => 'btn-secondary uppercase',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Full-Width Gray Button',
    			'selector' => 'a',  
    			'classes' => 'btn-secondary btn-full-width',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'All Caps Text',
    			'inline' => 'span',
    			'classes' => 'uppercase',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'UU Red Text',
    			'inline' => 'span',  
    			'classes' => 'uu-red',
    			'wrapper' => false
    		),
    		array(
    			'title' => 'Heading No Space before Paragraph',
    			'inline' => 'span',  
    			'classes' => 'heading-no-space-before-paragraph',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Stretch Image Full-Width',
    			'selector' => 'img',
    			'classes' => 'img-full-stretch',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Red Bullets List',
    			'selector' => 'ul',  
    			'classes' => 'red-bullets-list',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Slanted Lines Seperator',  
    			'selector' => 'hr',  
    			'classes' => 'chevron',
    			'wrapper' => false
    		),
    		array(  
    			'title' => 'Drop Cap',  
    			'selector' => 'p',  
    			'classes' => 'drop-cap',
    			'wrapper' => false
    		), 
    	);  
    	// Insert the array, JSON ENCODED, into 'style_formats'
    	$init_array['style_formats'] = json_encode( $style_formats );  
    	
    	return $init_array;  
      
    } 
    // Attach callback to 'tiny_mce_before_init' 
    add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );
    
Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More