offsetwp/editor-support

Choose the type of editor (Gutenberg, Classic, or none) based on the post type, post ID, or template, and configure its various features.

Fund package maintenance!
Buy Me A Coffee
Ko Fi

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/offsetwp/editor-support

1.0.2 2025-12-17 15:37 UTC

This package is not auto-updated.

Last update: 2025-12-19 14:17:48 UTC


README

OffsetWP Editor Support OffsetWP Editor Support

OffsetWP Editor Support

Choose the type of editor (Gutenberg, Classic, or none) based on the post type, post ID, or template, and configure its various features.

Installation

composer require offsetwp/editor-support

Usage

Basic

use OffsetWP\EditorSupport\EditorSupportManager;

$editor = EditorSupportManager::from_post_type( 'page' );
$editor
    ->set_classic_editor()
    ->remove_comments();

API

Selector

$editor = EditorSupportManager::from_post_type( 'page' ); // With post type
$editor = EditorSupportManager::from_post_id( 42 ); // With post ID
$editor = EditorSupportManager::from_template( 'template/contact.php' ); // With template name

Primary editor type

$editor->set_gutenberg_editor(); // Gutenberg
$editor->set_classic_editor(); // Classic Editor
$editor->set_empty_editor(); // No editor

⚠ If you wish to disable Gutenberg entirely, we recommend using the Classic Editor plugin.

Add editor features

$editor
    ->add_title()
    ->add_editor()
    ->add_author()
    ->add_thumbnail()
    ->add_excerpt()
    ->add_trackbacks()
    ->add_custom_fields()
    ->add_comments()
    ->add_revisions()
    ->add_page_attributes()
    ->add_post_formats();

Add custom feature

$editor->add_support( 'my-custom-feature' );

Add all features

$editor
    ->add_all() // Add all features
    ->add_all( 'content', 'thumbnail' ); // Add all features without specific ones

Remove editor features

$editor
    ->remove_title()
    ->remove_editor()
    ->remove_author()
    ->remove_thumbnail()
    ->remove_excerpt()
    ->remove_trackbacks()
    ->remove_custom_fields()
    ->remove_comments()
    ->remove_revisions()
    ->remove_page_attributes()
    ->remove_post_formats();

Remove custom feature

$editor->remove_support( 'my-custom-feature' );

Remove all features

$editor
    ->remove_all() // Remove all features
    ->remove_all( 'content', 'thumbnail' ); // Remove all features without specific ones