-
-
Notifications
You must be signed in to change notification settings - Fork 462
/
EnqueuedResourcesStandard.xml
53 lines (53 loc) · 1.23 KB
/
EnqueuedResourcesStandard.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<documentation title="Enqueued Resources">
<standard>
<![CDATA[
Scripts must be registered/enqueued via wp_enqueue_script().
]]>
</standard>
<code_comparison>
<code title="Valid: Script registered and enqueued correctly.">
<![CDATA[
<em>wp_enqueue_script</em>(
'someScript-js',
$path_to_file,
array( 'jquery' ),
'1.0.0',
true
);
]]>
</code>
<code title="Invalid: Script is directly embedded in HTML.">
<![CDATA[
printf(
'<em><script src="%s"></script></em>',
esc_attr( $path_to_file )
);
]]>
</code>
</code_comparison>
<standard>
<![CDATA[
Stylesheets must be registered/enqueued via wp_enqueue_style().
]]>
</standard>
<code_comparison>
<code title="Valid: Stylesheet registered and enqueued correctly.">
<![CDATA[
<em>wp_enqueue_style</em>(
'style-name',
$path_to_file,
array(),
'1.0.0'
);
]]>
</code>
<code title="Invalid: Stylesheet is directly embedded in HTML.">
<![CDATA[
printf(
'<em><link rel="stylesheet" href="%s" /></em>',
esc_attr( $path_to_file )
);
]]>
</code>
</code_comparison>
</documentation>