Skip to content

Commit

Permalink
Adds documentation for WordPress.WP.EnqueuedResources.
Browse files Browse the repository at this point in the history
Update WordPress/Docs/WP/EnqueuedResourcesStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Adds emphasis in code examples
  • Loading branch information
NielsdeBlaauw committed Nov 2, 2019
1 parent 2f396d1 commit b6e50ae
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions WordPress/Docs/WP/EnqueuedResourcesStandard.xml
@@ -0,0 +1,50 @@
<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',
'http://someurl/somefile.js',
array( 'jquery' ),
'1.0.0',
true
);
]]>
</code>
<code title="Invalid: Script is directly embedded in HTML.">
<![CDATA[
<script <em>src="http://someurl/somefile.js"</em>>
</script>
]]>
</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',
'https://example.com/somefile.css',
false,
'1.0.0'
);
]]>
</code>
<code title="Invalid: Stylesheet is directly embedded in HTML.">
<![CDATA[
<link rel="stylesheet"
<em>href="http://someurl/somefile.css"</em> />
]]>
</code>
</code_comparison>

</documentation>

0 comments on commit b6e50ae

Please sign in to comment.