offsetwp/editor-support 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

offsetwp/editor-support

最新稳定版本:1.0.2

Composer 安装命令:

composer require 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.

README 文档

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

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-26