File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <documentation xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4+ title =" Discouraged Constants"
5+ >
6+ <standard >
7+ <![CDATA[
8+ The use of certain WordPress native constants is discouraged. Use the recommended alternatives instead.
9+ ]]>
10+ </standard >
11+ <code_comparison >
12+ <code title =" Valid: Function used instead of discouraged WP constant." >
13+ <![CDATA[
14+ $dir = <em>get_stylesheet_directory()</em>;
15+ ]]>
16+ </code >
17+ <code title =" Invalid: Discouraged WP constant is used." >
18+ <![CDATA[
19+ $dir = <em>STYLESHEETPATH</em>;
20+ ]]>
21+ </code >
22+ </code_comparison >
23+ <standard >
24+ <![CDATA[
25+ The (re-)declaration of certain WordPress native constants is discouraged. Use the recommended alternatives instead.
26+ ]]>
27+ </standard >
28+ <code_comparison >
29+ <code title =" Valid: Using recommended alternative instead of (re-)declaring WP constant." >
30+ <![CDATA[
31+ <em>add_theme_support</em>(
32+ <em>'custom-header'</em>,
33+ array( 'width' => 200 )
34+ );
35+ ]]>
36+ </code >
37+ <code title =" Invalid: (Re-)declaring a WP constant." >
38+ <![CDATA[
39+ define(
40+ <em>'HEADER_IMAGE_WIDTH'</em>,
41+ 200
42+ );
43+ ]]>
44+ </code >
45+ </code_comparison >
46+ </documentation >
You can’t perform that action at this time.
0 commit comments