Created
August 12, 2015 20:30
-
-
Save hereswhatidid/891c2ac452f35fea89fb to your computer and use it in GitHub Desktop.
Adds a custom class to a specific WYSIWYG editor within Advanced Custom Fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_acf_admin_footer() { | |
?> | |
<script> | |
( function( $) { | |
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) { | |
if ( id === 'special-wysiwyg-field' ) { | |
mceInit.body_class += ' magical-field-class'; | |
} | |
return mceInit; | |
}); | |
})( jQuery ); | |
</script> | |
<?php | |
} | |
add_action('acf/input/admin_footer', 'my_acf_admin_footer'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment