Support

Account

Home Forums Front-end Issues Disable Text Tab in Post Editor for frontend form

Solved

Disable Text Tab in Post Editor for frontend form

    • buylov

    • January 14, 2016 at 9:49 pm

    Hello!

    I include edit title and post content for the frontend forms.

    This code:

    acf_form(array(
                                            'post_title' => true,
                                            'post_content' => true,
                     ),

    But in this case I can not adjust the field name and post content as the other fields of the ACF. However, I would like to change the settings of the field post content. For example, I would like to disable HTML (Text) Tab in post editor. Leave only the visual editor.

    Settings that work to backend forms, for example:

    function my_editor_settings($settings) {
    $settings['quicktags'] = false;
    return $settings;
    }
    
    add_filter('wp_editor_settings', 'my_editor_settings');

    It does not work for front-end ACF forms. Any suggestions how to do it?

    • James

    • January 15, 2016 at 5:24 pm

    Hi @buylov

    To remove the Visual/Text tab, you can edit your WYSIWYG field and set the “Tabs” as “Visual Only”.

    I hope this helps.

    • buylov

    • January 15, 2016 at 6:06 pm

    Yes, but ‘post_content’ is not a field ACF. This is a required field post.

    • James

    • January 15, 2016 at 6:45 pm

    Hi @buylov

    The easiest way would be using CSS to hide it. Something like this:

    div[data-name="_post_content"] .wp-editor-tabs { 
        display: none;
    }

    Hope this does the trick!

    • buylov

    • January 15, 2016 at 7:09 pm

    It works!

  • Hi, how can I hide the Text tab for all users, but admins ?

    Thanks a lot and best regards
    Beat

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.