Documents WordPress Classic Editor integration points and their Gutenberg equivalents

Overview

Gutenberg Migration Guide

This repository documents WordPress Classic Editor customization points and their Gutenberg equivalents (if such exist). Its goal is to help WordPress developers update their plugins and themes for Gutenberg compatibility.

This README.md provides an overview to all impacted hooks (actions and filters) and TinyMCE features. Each item then has an extended document with an overview, examples of existing usage, and documentation for its Gutenberg equivalent (if any).

For the full history, see WordPress/gutenberg#4151. Please open an issue to suggest new hooks, usage examples, or other ideas for improvement.

Sections: Actions & Filters | Core Features | TinyMCE

Actions & Filters

This table documents the most common actions and filters within the Classic Editor, and whether they still exist or have direct Gutenberg equivalents.

Action / Filter Still Exists? Gutenberg Equivalent? Learn More
default_excerpt Yes (GB 4.1) N/A
default_content Yes (GB 4.1) N/A
default_title Yes (GB 4.1) N/A
edit_form_top No None Edit Form Actions
edit_form_after_title No None Edit Form Actions
edit_form_before_permalink No None Edit Form Actions
edit_form_after_editor No None Edit Form Actions
enter_title_here Yes N/A
write_your_story Yes N/A
post_updated_messages No No Post Updated Messages Filter
media_buttons No Block Inserter Media Buttons
post_submitbox_minor_actions No None Post Submitbox Actions
post_submitbox_misc_actions No None Post Submitbox Actions
post_submitbox_start No None Post Submitbox Actions
default_page_template_title Yes N/A
page_attributes_dropdown_pages_args No None Dropdown Pages Args Filters
quick_edit_dropdown_pages_args No None Dropdown Pages Args Filters
admin_post_thumbnail_html No editor.PostFeaturedImage Post Thumbnail HTML Filter
admin_post_thumbnail_size No editor.PostFeaturedImage.imageSize Post Thumbnail Size Filter
mce_css No Enqueue Stylesheet MCE CSS Filter
image_send_to_editor No None Image Send To Editor Filter
post_gallery No None Post Gallery Filter

Core Features

This table documents common features within the Classic Editor, and whether they still exist or have direct Gutenberg equivalents.

Feature Still Exists? Gutenberg Equivalent? Learn More
Editor Stylesheets No Enqueue Stylesheet Editor Stylesheets
Custom Post Statuses No None Custom Post Statuses
Custom Fields Metabox No None Custom Fields Metabox
Media Tabs No None Media Tabs
Post Type Supports Yes N/A Post Type Supports
Screen Options No None Screen Options

TinyMCE

This table documents common TinyMCE customizations and whether they have direct Gutenberg equivalents.

Customization Still Exists? Gutenberg Equivalent? Learn More
dom.DOMUtils No None TinyMCE dom.DOMUTils
Editor No None TinyMCE Editor
mce_buttons Yes N/A TinyMCE Filters
mce_buttons_2 Yes N/A TinyMCE Filters
mce_buttons_3 Yes N/A TinyMCE Filters
mce_buttons_4 Yes N/A TinyMCE Filters
style_formats Partially N/A TinyMCE Style Formats
tiny_mce_before_init Yes N/A TinyMCE Filters
tiny_mce_plugins Yes N/A TinyMCE Filters
tiny_mce_external_plugins Yes N/A TinyMCE Filters
Toolbar Button No None TinyMCE Toolbar Button
Comments
  • Custom Inline markup for my themes

    Custom Inline markup for my themes

    I'm using mce_buttons_2 and tiny_mce_before_init to add custom inline markup easily in my posts (custom mark or span tags, or custom classes for links). I tried to extend the paragraph block as mentioned in 4658 without success for the moment. screenshot from 2018-09-05 15-35-14

    opened by bluisier 4
  • Insert shortcode - not a block

    Insert shortcode - not a block

    The current shortcode block inserts ... a block. My plugin inserts a shortcode that is a link that should go inline within the content, not as a separate block.

    So that users don't have to remember the arcane shortcode syntax I have a button on the editor that pops up a modal. The picks from a dropdown and types in some text, and the shortcode gets inserted at the cursor location. I've seen a number of plugins that so similar.

    Thanks

    opened by dmccan 4
  • Detect Editor Type

    Detect Editor Type

    I imagine many plugins will need to support the classic editor and Gutenberg. So, it would be helpful if the guild showed how to detect if on the edit screen we are using the classic editor or Gutenberg.

    Thanks

    opened by dmccan 4
  • Document common TinyMCE integrations

    Document common TinyMCE integrations

    There are a variety of ways developers might be interacting with TinyMCE (button registration, content manipulation, etc.). We should get them documented.

    opened by danielbachhuber 4
  • Add custom font to TinyMCE styles

    Add custom font to TinyMCE styles

    Currently supported by using the mce_css filter, for example:

    function my_tinymce_styles($style_string) {
    	if (!empty($style_string)) {
    		$style_string .= ',';
    	}
    	$style_string .= str_replace(',', '%2C', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700');
    	return $style_string;
    }
    add_filter('mce_css', 'my_tinymce_styles');
    
    opened by TimVevida 3
  • Some actions are not trigger

    Some actions are not trigger

    These action was working very good at the old / classic editor but now these are not working gutenberg editor....

    add_action('auto-draft_to_publish', array($this,'sbp_preserve_draft_date'), 10, 1);    
    add_action('draft_to_publish', array($this,'sbp_preserve_draft_date'), 10, 1);
    add_action('draft_to_private', array($this,'sbp_preserve_draft_date'), 10, 1);
    add_action('draft_to_pending', array($this,'sbp_preserve_draft_date'), 10, 1);
    
    function sbp_preserve_draft_date($post){
    	global $post;
        $release_date = get_post_meta($post->ID,'_fb_release_date',TRUE);
        //if ($release_date && $post->post_date != date('Y-m-d H:i:s',strtotime($release_date)) ){
        
        if (! empty($release_date)) {
          $post->edit_date = date('Y-m-d H:i:s',strtotime($release_date));
          $post->post_date = date('Y-m-d H:i:s',strtotime($release_date));
          $post->post_date_gmt = date('Y-m-d H:i:s',strtotime($release_date));
          wp_update_post($post);
        }
    }
    
    
    opened by umershaikh 2
  • Example of

    Example of "post_gallery" filter

    Please open a new issue to suggest additional examples of existing usage. — Post Gallery Filter

    The plugin Slick Slider (https://github.com/tyrann0us/slick-slider) uses the post_gallery filter to turn native galleries into sliders: https://github.com/tyrann0us/slick-slider/blob/761477365a31a2947f65dd19e8ffbc818c0815d9/inc/class-output.php#L39-L47

    Because of the missing filter the plugin ~does not work with Gutenberg~ cannot simply re-use it for websites that use the Block Editor, but the code has to be rewritten to use register_block_type()'s render_callback.

    Disclaimer: I'm the author of this plugin.

    enhancement 
    opened by tyrann0us 2
  • TinyMCE styleselect

    TinyMCE styleselect

    The TinyMCE styleselect is a way to define wrapping markup or classes to all or specific elements in the editor. For reference here is the TinyMCE and WordPress documentation for using the feature.

    It appears that this function will continue working in the Classic Editor block, but I think documenting the overlap of it and Gutenberg may be useful and appropriate for this guide. The ability to set wrapping markup is a defining feature of blocks and the ability to add classes is now often covered by the new style variant feature in Gutenberg which allows defining and applying CSS classes to blocks.

    opened by mrwweb 2
  • Documentation of Filterable TinyMCE Settings?

    Documentation of Filterable TinyMCE Settings?

    As noted in WordPress/gutenberg#7942, there is at least one TinyMCE filterable setting that currently doesn't work in Gutenberg when using the Classic Editor block. I don't know if all settings are ignored or if it's just that one. Either way, documenting charmap_append and potentially other settings that would appear to have Gutenberg equivalents (or should have) seems worthwhile.

    opened by mrwweb 2
  • Media Tab Support

    Media Tab Support

    Hi @danielbachhuber ,

    Does wordpress have any improvements about the https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/feature-media-tabs.md ?

    Since I am using this plugin to import videos to my system, I really need to update my Wordpress to support Gutenberg. Yet it is not supporting Custom Media Tab.

    Could you assist me for this issue?

    Thanks, Mustafa

    opened by karamusluk 1
  • The hook for editor.PostFeaturedImage is not executed

    The hook for editor.PostFeaturedImage is not executed

    Hello! I have been following all the discussions about the removal of the admin_post_thumbnail_html and the alternative for Gutenberg, however, for the latest version, the hooks just do not trigger.

    I am referring to wp.hooks.addFilter( 'editor.PostFeaturedImage', ... Is there some functional example available (the examples provided at https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/filter-admin-post-thumbnail-html.md are not working) or a known issue with these?

    Thank you!

    opened by Sisanu 1
  • editor.PostFeaturedImage append demo code doesn't allow pre-selected images

    editor.PostFeaturedImage append demo code doesn't allow pre-selected images

    I have added our custom plugin to append a string to the Featured Image block (which was originally taken care of using 2 lines of PHP code - just saying).

    Here is the JS file:

    function addFeaturedImageDescription (original) { 
    	return function() { 
    		return (
    			wp.element.createElement( 
    				'div', 
    				{ key: 'outer' + Math.random() }, 
    				[
    					_.extend( original( {} ), { key: 'my-key' } ),
                        'Suggested dimensions: 1104px x 736px'
    				]
    			)
    		);
    	}
    }
    
    wp.hooks.addFilter( 
    	'editor.PostFeaturedImage', 
    	'pluginname/addFeaturedImageDescription', 
    	addFeaturedImageDescription 
    );
    

    When I run that, I get the Featured button and my text - but when I try to edit a post that already has a featured image, it is not pre-selected. If I try to select an image, I get "t is not a function" in edit-post.min.js:12:7166.

    Something is amiss from the code provided (as it works fine when I just return original). Can you please provide functional code on how to handle this.

    Thanks.

    opened by JSalvo220 0
  • editor.PostFeaturedImage example throws an error

    editor.PostFeaturedImage example throws an error

    Hi, thank you very much for your awesome work here.

    I am attempting to output a simple bit of text after the featured image picker via the example at https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/filter-admin-post-thumbnail-html.md .

    See screenshot, I get TypeError: t is not a function.

    In order to reproduce the error, you must click on the featured image UI and select an image.

    I would be more than happy to migrate this comment to a more appropriate venue if you could be so kind to suggest one. Thank you again for your awesome work!

    screen shot 2019-02-11 at 3 56 04 pm question 
    opened by scofennell 5
  • get_image_tag filter removed

    get_image_tag filter removed

    The get_image_tag filter no longer exists in Gutenberg.

    add_filter('get_image_tag', 'show_post_image_source', 0, 5);
    function show_post_image_source($html, $post_id, $post_thumbnail_id, $size, $attr) {
        die('hellooooo');
        return $html;
    }
    

    ...site never dies. Anyone know the equivalent in Gutenberg?

    opened by ChrisBAshton 1
  • post_submitbox_misc_actions Equivalent

    post_submitbox_misc_actions Equivalent

    post_submitbox_misc_actions has an Gutenberg Equivalent: PluginPostStatusInfo. See: https://github.com/wordpress/gutenberg/blob/master/edit-post/README.md#pluginpoststatusinfo

    opened by Soean 1
  • remove_meta_box

    remove_meta_box

    In the current editor it is possible to suppress also every part of the interface through the use of remove_metabox(). In the new editor, metaboxes are a legacy concept, and document settings are implemented in alternative ways.

    Specific examples

    1. Suppressing post-specific content from admin-only custom post types (e.g. a redirect CPT, which does not require an author, page attributes etc.)

    2. In the current editor, it is possible to remove a core metabox, and replace it with a custom implementation. For example, a common use-case it to remove taxonomy metaboxes in order to provide a new interface which uses radio buttons (instead of checkboxes). e.g. https://plugins.trac.wordpress.org/browser/radio-buttons-for-taxonomies

    Gutenburg alternative

    There appears to be no ideal alternative in Gutenburg. I have seen it suggested that non-content posts, (such as the redirect CPT example) should continue to use the old editor, but this does seem to be limiting the usefulness of the new editor.

    It may be possible to hide Document sidebar sections with CSS, but this is going to be a brittle solution unsuited to most use-cases.

    opened by braders 3
Owner
Daniel Bachhuber
CTO, TinyBit. Proud father and husband. Previously: @wp-cli maintainer, @WordPress committer.
Daniel Bachhuber
A plugin to disable the drop cap option in Gutenberg editor paragraph block. This is version 2.

Disable Drop Cap (v2) A plugin to disable drop cap option in the Gutenberg editor block editor paragraph block. Note for WordPress 5.8 With WordPress

Johannes Siipola 4 Jan 4, 2022
The easiest way to develop and release Gutenberg blocks (components) for WordPress

Contents Install Comparison with competition Future Plans Usage Creating a Block Install npm install gutenblock -g This is a Gutenberg plugin creator

Zach Silveira 239 Nov 11, 2022
📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.

create-guten-block is zero configuration dev-toolkit (#0CJS) to develop WordPress Gutenberg blocks in a matter of minutes without configuring React, w

Ahmad Awais ⚡️ 3.1k Dec 23, 2022
Examples for extending WordPress/Gutenberg with blocks.

Gutenberg Examples Examples for extending Gutenberg with plugins which create blocks. See also: Gutenberg developer documentation Installation Gutenbe

null 1.1k Dec 29, 2022
WordPress plugin boilerplate using React and Block Editor components.

PluginWP Foundation ?? UNDER DEVELOPMENT ?? This code serves as a starting point for building a WordPress plugin using React and the block editor comp

JR Tashjian 5 Dec 8, 2022
Gutenberg Custom Fields... wait what?

Gutenberg Custom Fields Gutenberg Custom Fields allows you to control the content of the Gutenberg edit screen by creating pre-filled templates. Navig

Riad Benguella 192 Dec 24, 2022
Query gutenberg blocks with wp-graphql

WPGraphQL Gutenberg Query gutenberg blocks through wp-graphql Usage Docs Join our community through WpGraphQL Slack Install Requires PHP 7.0+ Requires

null 270 Jan 3, 2023
WordPress plugin people can use to embed to their website: a Mintbase NEAR NFT and Mintbase NEAR store

mintbase-embed WordPress plugin people can use to embed to their website: a Mintbase NEAR NFT and Mintbase NEAR store This is demo plugin that allows

null 3 Oct 1, 2021
🚀WordPress Plugin Boilerplate using modern web techs like TypeScript, SASS, and so on... on top of a local development environment with Docker and predefined GitLab CI for continous integration and deployment!

WP React Starter: WordPress React Boilerplate DEPRECATED: WP React Starter was a "research project" of devowl.io for the development of our WordPress

devowl.io GmbH 344 Jan 1, 2023
A simple framework for running WordPress unit and integration tests.

Touchstone A modern wrapper around the official WordPress testsuite. It can be used to run both Unit and Integration tests. Installation Run the follo

Seb Kay 15 Jul 28, 2022
🚀 All-in-one enhancement plugin that improves WordPress & BuddyBoss integration.

=== Buddyboss Extended Add-on === Contributors: jcatama Donate link: https://www.paypal.me/jcatama Tags: buddyboss, buddypress, learndash, forums, gro

Albert Catama 1 Oct 12, 2022
🚀 A distributed content delivery network (DCDN) integration plugin for wordpress

DCDN Engine - WordPress DCDN Plugin Simply integrate a Distributed Content Delivery Network (DCDN) into your WordPress site. Preview Plugin Installati

daqNext 6 Nov 30, 2022
A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

Dropndot Limited 91 Dec 26, 2022
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. ?? Demo (coming so

Waren Gonzaga 3 Nov 15, 2021
Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library.

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library. Import Jamendo playlists with tracks in WordPress posts.

Pierre Saikali 3 Dec 7, 2022
A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

WP Bootstrap 3.3k Jan 5, 2023
The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone.

Pronamic WordPress Basecone The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone. Table of contents Au

Pronamic 1 Oct 19, 2021
Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.

Twenty Twenty-Two Welcome to the development repository for the default theme that will launch with WordPress 5.9. About Twenty Twenty-Two is designed

null 414 Nov 28, 2022
Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer.

Description Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer. Support [audio] tag, compatible with AMP. Requirement WordPr

Karl Chen 24 Nov 3, 2022