File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments