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');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.