From the course: PHP for WordPress

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

PHP in the Block Editor

PHP in the Block Editor

- [Narrator] Now that the block editor and site editor are the primary methods of making WordPress themes, it's good to know what's available to you in PHP for you to leverage when doing WordPress development. This won't tell you exactly how to develop a WordPress theme, there are other helpful courses and resources for that. But if you're going to leverage PHP for the block editor, there are a few helpful functions. The first is a function called do_blocks. If you want to convert a set of HTML comments into actual blocks, then do_blocks is the function for you. This is especially helpful if you have some block patterns that you've exported from the actual block editor that you want to use in a theme or plugin. If there's a block template part, header, footer, sidebar, et cetera, you want to use in your theme or plugin, you can call the function block_template_part. There are also specific functions for both the header area and footer area. If you want some more information on how all…

Contents