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
Originally posted by justintadlock January 25, 2024
A solid tutorial covering what functions are available to you when building patterns. For example, did you know that patterns are executed on init, a time when most WP conditionals are not yet set?
Why use PHP? Internationalization, dynamic URLs for loading media, and more.
You can also do things like loops instead of printing the block markup for repeated sections of the pattern with the same content (for example, a Columns block with the same nested columns).
The text was updated successfully, but these errors were encountered:
I feel like that's the best place for this at this time. We can always build on top of that documentation with a Dev Blog article in the future. But I feel like I've accomplished what I set out to do (create a resource for themers to learn how to use PHP in patterns), so I'm closing this for now.
If anyone wants to pick it up with a new angle, we can always reopen.
Discussed in #210
Originally posted by justintadlock January 25, 2024
A solid tutorial covering what functions are available to you when building patterns. For example, did you know that patterns are executed on
init
, a time when most WP conditionals are not yet set?Why use PHP? Internationalization, dynamic URLs for loading media, and more.
You can also do things like loops instead of printing the block markup for repeated sections of the pattern with the same content (for example, a Columns block with the same nested columns).
The text was updated successfully, but these errors were encountered: