Skip to content

Commit 0bb1f78

Browse files
committed
Apply suggestions from code review and a few more minor changes
1 parent 60f36e3 commit 0bb1f78

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

WordPress/Docs/WP/GlobalVariablesOverrideStandard.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
<![CDATA[
88
WordPress global variables should not be overridden.
99
10-
Two WordPress global variables, `$content_width` and `$wp_cockneyreplace`, are
10+
Two WordPress global variables, `$content_width` and `$wp_cockneyreplace`, are
1111
specifically intended to be overridden by themes/plugins and are exempt from this rule.
1212
]]>
1313
</standard>
1414
<code_comparison>
15-
<code title="Valid: Different variable name.">
15+
<code title="Valid: Using non-WordPress global names.">
1616
<![CDATA[
1717
<em>$my_query</em> = new WP_Query( $args );
1818
1919
20-
<em>$GLOBALS['my_data']</em> = "some data";
20+
<em>$GLOBALS['my_data']</em> = 'some data';
2121
]]>
2222
</code>
23-
<code title="Invalid: Global variable overridden.">
23+
<code title="Invalid: WordPress global variable overridden.">
2424
<![CDATA[
2525
<em>global $wp_query;</em>
2626
<em>$wp_query</em> = new WP_Query( $args );
2727
28-
<em>$GLOBALS['wp_query']</em> = new WP_Query( $args );
28+
<em>$GLOBALS['post']</em> = get_post( 1 );
2929
]]>
3030
</code>
3131
</code_comparison>

0 commit comments

Comments
 (0)