Using PHP Namespaces & Autoloaders In WordPress Plugins

Pubblicato il: 31 gennaio 2022
sul canale di: 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...


In questa pagina del sito puoi guardare il video online Using PHP Namespaces & Autoloaders In WordPress Plugins della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Plugin Machine 31 gennaio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 613 volte e gli è piaciuto 7 spettatori. Buona visione!