• Resolved zabriskie73

    (@zabriskie73)


    Hi,

    Working only with ACF for my content, the WP editor box is totally useless for me and takes place on the top of New Post.
    I know how to disable visual editor but i want to turn off totally this box (and gutenber of course), or at least put it on the bottom of the page.

    I just want to keed “Add a media” button.

    I tried this code on function.php but it failed.

    add_action( ‘init’, function() {
    remove_post_type_support( ‘post’, ‘editor’ );
    remove_post_type_support( ‘page’, ‘editor’ );
    }, 99);

    Anyone has an idea ?

    Thanks

    • This topic was modified 2 years, 5 months ago by bcworkz. Reason: code format fixed
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Thread Starter zabriskie73

    (@zabriskie73)

    Hi,

    Thanks, it works with this code for both posts and pages on functions.php file

    add_action('init', 'my_remove_editor_from_post_type');
    function my_remove_editor_from_post_type() {
    remove_post_type_support( 'post', 'editor' );
    remove_post_type_support( 'page', 'editor' );
    
    	}

    Just too bad that it make the “add media” button vanish with editor
    Maybe there is a way to keep it ? Or maybe i dream too high 🙂

    Thanks anyway

    • This reply was modified 2 years, 5 months ago by zabriskie73.
    • This reply was modified 2 years, 5 months ago by bcworkz. Reason: code format fixed
    Moderator t-p

    (@t-p)

    Glad its sorted 🙂

    Moderator bcworkz

    (@bcworkz)

    The add media button is only with the classic editor. The block editor adds media through block insertions. Do you need the classic editor for other post types? If not, why have the plugin at all? Authors can always add media via the +New > Media admin bar item. It’s still one-click access, but it also takes you off the current page, so it’s not really a substitute for the button.

    While it seems excessive IMO to keep the entire classic editor plugin just to have an add media button, you could get the button back by enabling the editor, but hiding most of it with admin CSS so only the button remains visible. The editor is still loaded with the page, but users cannot see it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable post text editor (Classic and Gutenberg)’ is closed to new replies.