Home Forums Backend Issues (wp-admin) Does a "the_editor" hook like in WP exisists?


Does a "the_editor" hook like in WP exisists?

  • Hi!

    In Wp “the_editor” filter hook lets developers change the markup of the (not TinyMce) editor like so:

    add_filter('the_editor', 'example');
    function example($content) {
    	// here we're adding a "pluto" class...
    	$content = '<div class="pluto" id="wp-content-editor-container" class="wp-editor-container"><div id="ed_toolbar" class="quicktags-toolbar"></div><textarea class="wp-editor-area" style="height: 300px" autocomplete="off" cols="40" name="content" id="content">%s</textarea></div>';
    	return $content;

    I would make the same for Acf (not TinyMce) implementation of the editor to add, for example, a “maxlength” attribute to the (not TinyMce) editor’s <textarea> of the ‘wysiwyg’ field for some fields.

    Many thanks in advance for your help!

  • Not sure what you mean by “the (not TinyMce) editor”. Do you mean the editor in ACF Version 4?

  • Hi mean the ‘HTML tab’, no the ‘Visual’ one, sorry I have not expressed well, thanks!

  • There isn’t any way that you can “wrap” any of the ACF html output in additional div elements. You can add classes to the “wrapper” element when creating a field and you can also add classes and wrapper attributes by using the acf/prepare_field hook

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Does a "the_editor" hook like in WP exisists?’ is closed to new replies.