Skip to content

Commit a9233d4

Browse files
committed
Replace emphasis and blockquote HTML code
Replaced them with the proper markdown alternatives.
1 parent cf35267 commit a9233d4

File tree

1 file changed

+11
-10
lines changed
  • wordpress-coding-standards

1 file changed

+11
-10
lines changed

wordpress-coding-standards/php.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Text that goes into attributes should be run through `esc_attr()` so that single
2121

2222
### Indentation
2323

24-
Your indentation should always reflect logical structure. Use <strong>real tabs</strong> and <strong>not spaces</strong>, as this allows the most flexibility across clients.
24+
Your indentation should always reflect logical structure. Use **real tabs** and **not spaces**, as this allows the most flexibility across clients.
2525

2626
Exception: if you have a block of code that would be more readable if things are aligned, use spaces:
2727

@@ -32,7 +32,7 @@ Exception: if you have a block of code that would be more readable if things are
3232
[tab]$foo5 = 'somevalue4';
3333
```
3434

35-
For associative arrays, <em>each item</em> should start on a new line when the array contains more than one item:
35+
For associative arrays, _each item_ should start on a new line when the array contains more than one item:
3636

3737
```php
3838
$query = new WP_Query( array( 'ID' => 123 ) );
@@ -72,7 +72,7 @@ switch ( $type ) {
7272
}
7373
```
7474

75-
<strong>Rule of thumb:</strong> Tabs should be used at the beginning of the line for indentation, while spaces can be used mid-line for alignment.
75+
**Rule of thumb:** Tabs should be used at the beginning of the line for indentation, while spaces can be used mid-line for alignment.
7676

7777
### Brace Style
7878

@@ -111,7 +111,7 @@ foreach ( $items as $item ) {
111111
}
112112
```
113113

114-
Note that requiring the use of braces just means that <em>single-statement inline control structures</em> are prohibited. You are free to use the [alternative syntax for control structures](https://www.php.net/manual/en/control-structures.alternative-syntax.php) (e.g. `if`/`endif`, `while`/`endwhile`)—especially in your templates where PHP code is embedded within HTML, for instance:
114+
Note that requiring the use of braces just means that _single-statement inline control structures_ are prohibited. You are free to use the [alternative syntax for control structures](https://www.php.net/manual/en/control-structures.alternative-syntax.php) (e.g. `if`/`endif`, `while`/`endwhile`)—especially in your templates where PHP code is embedded within HTML, for instance:
115115

116116
```php
117117
<?php if ( have_posts() ) : ?>
@@ -219,7 +219,7 @@ if ( $a === $b ) { ?>
219219

220220
### No Shorthand PHP Tags
221221

222-
<strong>Important:</strong> Never use shorthand PHP start tags. Always use full PHP tags.
222+
**Important:** Never use shorthand PHP start tags. Always use full PHP tags.
223223

224224
Correct:
225225

@@ -568,23 +568,24 @@ switch ( $foo ) {
568568

569569
The `goto` statement must never be used.
570570

571-
The `eval()` construct is <em>very dangerous</em>, and is impossible to secure. Additionally, the `create_function()` function, which internally performs an `eval()`, is deprecated in PHP 7.2. Both of these must not be used.
571+
The `eval()` construct is _very dangerous_, and is impossible to secure. Additionally, the `create_function()` function, which internally performs an `eval()`, is deprecated in PHP 7.2. Both of these must not be used.
572572

573573
### Error Control Operator `@`
574574

575575
As noted in the [PHP docs](https://www.php.net/manual/en/language.operators.errorcontrol.php):
576576

577-
<blockquote>PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.</blockquote>
577+
> PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
578578
579579
While this operator does exist in Core, it is often used lazily instead of doing proper error checking. Its use is highly discouraged, as even the PHP docs also state:
580580

581-
<blockquote>Warning: Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.</blockquote>
581+
> Warning: Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.
582582
583583
### Don't `extract()`
584584

585585
Per [#22400](https://core.trac.wordpress.org/ticket/22400 "Remove all, or at least most, uses of extract() within WordPress"):
586-
<blockquote>`extract()` is a terrible function that makes code harder to debug and harder to understand. We should discourage it's [sic] use and remove all of our uses of it.
587-
</blockquote>
586+
587+
> `extract()` is a terrible function that makes code harder to debug and harder to understand. We should discourage it's [sic] use and remove all of our uses of it.
588+
588589

589590
Joseph Scott has [a good write-up of why it's bad](https://blog.josephscott.org/2009/02/05/i-dont-like-phps-extract-function/).
590591

0 commit comments

Comments
 (0)