Search code examples
wordpressfunctionwordpress-gutenberggutenberg-blocks

Guttenburg and Classic Editor - How to use the custom guttenburg block in classic editor?


I am making a theme, in that I have created some custom blocks for guttenburg but the problem is how the user can use the guttenburg blocks if he/she switches to classic editor.

For an example,

Let suppose I have created a button block ( I know it's already there ) but a custom one so how the user is able to access it, when he/she swithces to the classic editor.

Is it really possible or not. If yes than how.


Solution

  • Gutenberg is a React.js based editor and an advancement to classic editor. WordPress provides us action hooks through which we bind data or our blocks to Gutenberg Editor.

    Classic editor is simple editor which I think using just simple JavaScript so you can't use Gutenberg blocks on it as they are React based. Although you can render the same frontend using shortcode to give user option to embed data through classic editor but it will be waste of time because you have an advanced editor already present.

    As far as I work on Gutenberg I can say that Gutenberg is very client friendly, so it's better to use and prefer that.