June 13, 2013
This presentation covers techniques and coding standards for developing concise, high-quality, re-usable theme functionality using Object Oriented Programming methodology. Learn how to employ the WordPress actions and filters API to create communication channels between objects without creating fragile object dependencies. Topics covered include encapsulation, re-usability, singletons and best practices. Naming conventions for symbols and files will be covered and explained.
June 14, 2013 at 5:00 am |
Often overlooked regarding anonymous functions. You can pass in variables from the outside scope quite easily with ‘use()’:
LikeLike
July 22, 2013 at 7:22 am |
Robert, you are right that anonymous functions are very useful, especially when defining short filter or action handlers that use variables in the current scope (closures.)
In this talk, I tried to avoid using PHP features that are newer than the minimum version of PHP required by WordPress, which is 5.2.4. Since closures / anonymous functions are a PHP 5.3-ism, I didn’t want to encourage their usage and then have developers mystified at why their code breaks on a host that only supports PHP 5.2.
Thanks for your input!
LikeLike
July 31, 2013 at 4:08 am |
Hi Ben,
Your presentation made me change the way I used to code WordPress Theme.
My theme (Customizr) is built upon the OOP principles you describes.
Thanks for those awesome slides!
PS : I credit you in my functions.php file
LikeLike