0

For plugin development in WordPress 5, is a block the same as a plugin today? If I were going to create a todo list, for example, is that now called a block?

I did look here, but didn't see it,

https://codex.wordpress.org/Writing_a_Plugin

To make sure I am not learning incorrectly, am I correct that if I learn to write a plugin in 4.9.x, it will be the same process as building a plugin in 5? I do not mean a 4.9 will "just work," only the learning of how to build a plugin.

1
  • Do you mean Gutenberg Block?
    – idpokute
    Sep 4, 2018 at 16:05

2 Answers 2

2

For plugin development in WordPress 5, is a block the same as a plugin today?

No, blocks are an entirely different thing. Blocks are blocks of content. The closest thing to them at the moment are shortcodes and possibly widgets.

Plugins are PHP files with a comment at the top of the main file that contains the phrase Plugin Name:. They allow WP to load bundles of code.

Case in point, if you remove plugins, how would you add custom blocks?

If I were going to create a todo list, for example, is that now called a block?

There's not enough information to define this question, you could implement a todo list block yes. You could use shortcodes, post types, you could do lots of things. None of that changes


I would suggest installing the Gutenberg editor and testing it out. You will quickly see that all the existing methods should still work. You can also attempt to build a simple block. Now is the time to test and give feedback, once Gutenberg is merged and 5.0 is released it will be too late to change how development works fundamentally due to backwards compatibility

3
  • Is any of the plugin development for 5 is supposed to change?
    – johnny
    Sep 4, 2018 at 16:41
  • Things change in every version, although old stuff typically continues to work. Keep an eye on make.wordpress.org/core if you want to stay up to speed. Sep 6, 2018 at 11:13
  • 1
    @johnny backwards compat means things shouldn't break if they were built correctly and without hacks. If plugin development is supposed to change then there will be blog posts on the official Make blogs explicitly saying so, as well as in the release post. I suggest you install the gutenberg plugin and see for yourself ( and the classic editor plugin )
    – Tom J Nowell
    Sep 6, 2018 at 12:25
1

No. As described in the documentation:

Plugins are packages of code that extend the core functionality of WordPress. WordPress plugins are made up of PHP code and other assets such as images, CSS, and JavaScript.

So they can be basically anything, and work by using WordPress APIs to add or change functionality of pretty much every part of WordPress. They can add Post Types, Widgets, Shortcodes and more.

"Blocks" are a feature of Gutenberg, the new editor slated for WordPress 5.0. In the Gutenberg editor pages and posts are built out of these blocks. Blocks are a lot like widgets but they're added to post content using the editor, and are - ostensibly - WYSIWYG, however they work completely differently under the hood.

In 5.0 plugins will be able to register new blocks for use in the editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.