Using PHP Namespaces & Autoloaders In WordPress Plugins

Veröffentlicht am: 31 Januar 2022
auf dem Kanal: Plugin Machine
613
7

When we build WordPress Plugins, we need to make sure none of our functions or classes have the same name as any of the other classes or functions from any of the other WordPress plugins installed on the site. How do we avoid this? PHP namespaces, that's how.

In this video, I show how PHP namespaces and autoloaders can be used in WordPress plugins. I explain how the PSR-4 standard helps us name and organize our code. I use phpunit to show how it works.

🌲 https://pluginmachine.com/blog/doc/wo...
🌲 My 2021 blog post about using PHP Namespaces:
https://joshpress.net/blog/php-namesp...
🌲 My 2015 blog post about a talk I gave about using PHP Namespaces. with a link to the slides and video:
https://legacy.joshpress.net/gain-wor...
🌲 My 2015 blog post on Torque about using Composer and PHP Namespaces:
https://torquemag.io/2015/01/using-cl...


Auf dieser Seite können Sie das Online-Video Using PHP Namespaces & Autoloaders In WordPress Plugins mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Plugin Machine 31 Januar 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 613 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!