Skip to content

What you *can* and *cannot* do with PHP in patterns #214

@bph

Description

@bph

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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions