Support

Account

Home Forums Front-end Issues Use textarea instead of TinyMCE for post_content

Solving

Use textarea instead of TinyMCE for post_content

  • Hello!

    First of all thanks a lot for the plugin!
    I use Advanced Custom Fields version 5.
    Today I successfully created Front end form to create a new post.
    It uses WYSIWYG editor TinyMCE for post_content field. But I would like to use simple textarea for post_content field when Front end. Is it possible? How?

    BTW I use version 5 because it allows to work with post_content and post_title very easily. And as far as I understand in version 4 I need to create fictive fields in Field Group for such purpose. And then use acf/pre_save_post filter to put data from these fictive fields to post_title and post_content. Am I right?

    Thanks in advance for your support!

  • Found the way by myself:

    add_filter('acf/get_valid_field/type=wysiwyg', 'my_get_valid_field_post_content');
    function my_get_valid_field_post_content( $field )
    {
        if ( $field['name'] == 'post_content' )
        	$field['type'] = 'textarea'; 
        return $field;
    }

    But please reply to part 2 of my first message about difference between version 4 and 5 and how they work with post_content.

    Thanks in advance!

  • Thanks Krendel for the answer.
    For current version (I use 5.0.7), you need to use _post_content.

    add_filter('acf/get_valid_field/type=wysiwyg', 'my_get_valid_field_post_content');
    function my_get_valid_field_post_content( $field )
    {
        if ( $field['name'] == '_post_content' )
        	$field['type'] = 'textarea'; 
        return $field;
    }
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Use textarea instead of TinyMCE for post_content’ is closed to new replies.