What you *can* and *cannot* do with PHP in patterns #210
Replies: 2 comments
-
After this topic was approved, the discussion is locked. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Will be covered in the Theme Handbook (see closing comment on the issue) which also closed this discussion |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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).
Beta Was this translation helpful? Give feedback.
All reactions