Support

Account

Home Forums General Issues WYSIWYG Inline-Styles / text-align Reply To: WYSIWYG Inline-Styles / text-align

  • Thanks, i found that link a while ago, but i was to stupid to use it properly…

    For anyone who might need it sometime:

    
    function change_mce_options($settings) {
    
    $new_formats = array(
    			'aligncenter' => array(
    				'selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
    				'classes' => 'textcenter',
    		)
    	);
    
    $settings['formats'] = json_encode($new_formats);
    
    return $settings;
    
    }
    add_filter('tiny_mce_before_init', 'change_mce_options');