Skip to content

Commit 3c26be4

Browse files
rodrigoprimojrfnl
andcommitted
Apply suggestions from code review
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
1 parent bc4c983 commit 3c26be4

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

WordPress/Docs/PHP/RestrictedPHPFunctionsStandard.xml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
>
66
<standard>
77
<![CDATA[
8-
Certain PHP functions must not be used, as they have been deprecated and removed from PHP or pose security risks. Use the recommended alternatives instead.
8+
Certain PHP functions must not be used, as they pose security risks. Use the recommended alternatives instead.
99
]]>
1010
</standard>
1111
<code_comparison>
12-
<code title="Valid: Using an anonymous function.">
12+
<code title="Valid: Using an anonymous function (closure).">
1313
<![CDATA[
14-
$function = <em>function ()</em> {
15-
return foo( 'bar' );
16-
};
14+
add_action(
15+
'init',
16+
<em>function () {
17+
return foo( 'bar' );
18+
}</em>
19+
);
1720
]]>
1821
</code>
1922
<code title="Invalid: Using create_function().">
2023
<![CDATA[
21-
$function = <em>create_function</em>(
22-
'',
23-
'return foo( "bar" );'
24+
add_action(
25+
'init',
26+
<em>create_function(
27+
'',
28+
'return foo( "bar" );'
29+
)</em>
2430
);
2531
]]>
2632
</code>

0 commit comments

Comments
 (0)