When writing PHP code for WordPress blocks:
-
Start with standard block header comment and settings:
- Use /** Block: Name */ format
- Define any required settings ($js, etc.) at the top
-
Follow a top-down logic flow:
- Process all data/logic at the top of the file
- Build HTML string variables progressively
- Use heredoc syntax for final HTML assembly