Home › Forums › Backend Issues (wp-admin) › How to add a class input field to WYSIWYG link insert › Reply To: How to add a class input field to WYSIWYG link insert
This is not the fault of ACF, but TinyMCE (and a little bit of WP for stripping it down).
See: http://code.tutsplus.com/tutorials/adding-custom-styles-in-wordpress-tinymce-editor–wp-24980
Basically, you’ll need to write your own functions.php filter or install this plugin: http://wordpress.org/extend/plugins/tinymce-advanced/
Filter example:
add_filter( 'tiny_mce_before_init', 'custom_mce_before_init' );
function custom_mce_before_init( $settings ) {
$style_formats = array(
array(
'title' => 'Some Style',
'selector' => 'a',
'classes' => 'my-anchor-class',
)
);
$settings['style_formats'] = json_encode( $style_formats );
return $settings;
}
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.