Загрузка...

How to Create Reusable Components for WordPress, Using PHP

If you are developing your own theme or plugin, it is useful to structure anything that is displayed on the front-end as a component.

In this video, I will explain a useful architecture that can be used to develop PHP based components. This architecture is very useful for developing any custom component, such as buttons, post grids, or anything else.

You will learn about:
- A proper file and folder structure for your code
- Using object oriented programming practices to create modular code
- Separate logic from templates
- Using modern bundles to bundle your assets (JavaScript and CSS)

00:00 Start
00:29 Prerequisites
01:52 Plugin Setup
03:49 OOP & Autoloading Setup
11:19 The Plugin Main Class
15:27 Autoloading Explained
17:47 The Component Class
31:21 Example Component Class
35:37 The Component Template
37:37 Implementing Components
42:53 Bundling Assets with ESBuild
47:16 Enqueueing Assets
50:26 Conclusion
This video is aimed at plugin and theme developers. You can read the article here: https://makeitwork.press/reusable-components-wordpress/

The code is also available on Github:
https://github.com/makeitworkpress/wp-php-components-example

Check me out at:
https://makeitwork.press

Follow me on social media:
Twitter: https://twitter.com/makeitworkpress/
LinkedIn: https://www.linkedin.com/company/make-it-workpress/
Github: https://github.com/makeitworkpress/

My videos may contain affiliate links to fund the time spent on creating, testing and, reviewing. This won't cost you anything extra, but brings me some extra bread to the table.

Видео How to Create Reusable Components for WordPress, Using PHP канала Make it WorkPress
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять