Support

Account

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;
    }