From 28f04ddbc45f73a4eb91cc1dd59a8909102b91ab Mon Sep 17 00:00:00 2001 From: edocev Date: Mon, 13 Dec 2021 18:36:58 +0200 Subject: [PATCH] Update of php.md - Opening and Closing PHP Tags Section The Opening and Closing PHP Tags Section - Specifically the case of single lines PHP inside HTML blocks was unclear and not full. Please see the above-proposed suggestion for edit and further improve that part of the documentation --- wordpress-coding-standards/php.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/wordpress-coding-standards/php.md b/wordpress-coding-standards/php.md index 9b600cd..4eef2d7 100644 --- a/wordpress-coding-standards/php.md +++ b/wordpress-coding-standards/php.md @@ -200,12 +200,34 @@ Correct (Single Line): ``` +When embedding single lines of PHP within an HTML block, the PHP open and close tags must be on the same line as the PHP code, surrounding it. + +Correct: + +```php +
+ +
+ +
+ +
+``` + Incorrect: ```php -if ( $a === $b ) { ?> - - + +
+ +
+ + ```

No Shorthand PHP Tags