You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.
Since this is a theme, would this be as relevant? I should think the theme would have minimal logic. I think it should look a lot like any PHP logic that is found in _s or any of the core themes. Namely: prefixed global functions.
Correct, there will things like theme support, potentially reusable template tags, potentially customizer settings.
If we decide to go for simple hook -> callback, we can agree to adopt an FP pattern like Underscores does (one of my favorite when done right) rather than an OO Pattern. Underscores doesn't have tests though and anything which contain logic should have tests for it.
Namely: prefixed global functions.
That triggered my attention, we are going to use namespaces right? If yes, then no need to prefix functions.
I don't think we should use namespaces for this, necessarily. The goal here is to provide an example theme that will get users up to speed with building an AMP-supporting theme as seamlessly as possible. Using namespaces and OOP and anything else that isn't found in _s could be a barrier to that. So yeah, just prefixed global functions is the normal way to develop a theme that developers are familiar with. We're not trying to create a theme that showcases best practices for modern PHP development. I'm trying to get confirmation, but PHP 5.2 may be required for WordPress.org theme directory as well.
I would suggest to agree on a Design Pattern (ex. MVC, Simple Factory ...) which should be followed throughout the code base.
The text was updated successfully, but these errors were encountered: