Skip to content

Commit

Permalink
Add: documentation for FileName sniff
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic-Sevic committed Sep 17, 2024
1 parent 7f76630 commit 6d1f6bb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions WordPress/Docs/Files/FileNameStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<documentation title="File Name Standards">
<standard>
<![CDATA[
Ensures that file names meet the following standards:
- Filenames should be all lowercase with hyphens separating words.
- Class file names should be based on the class name with "class-" prepended.
- Files in `wp-includes` containing template tags should end in `-template`.
If `$is_theme` property is set to `true` certain theme specific exceptions are made for underscores.
]]>
</standard>
<code_comparison>
<code title="Valid: All lowercase with only hyphens as word separators and proper use of prefix/suffix.">
<![CDATA[
echo taxonomy<em>-</em>my<em>-</em>term.inc
echo <em>s</em>ome<em>f</em>ile.inc
echo <em>class</em>-testsample.inc
echo other<em>-</em>punctuation.inc
echo general<em>-template</em>.php
]]>
</code>
<code title="Invalid: Use of other punctuation, uppercase, or missing prefix/suffix.">
<![CDATA[
echo taxonomy-my<em>_</em>term.inc.
echo <em>S</em>ome<em>F</em>ile.inc
echo <em>testsample</em>-unit-2.inc
echo other<em>+</em>punctuation<em>#</em>.inc
echo <em>general</em>.php
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit 6d1f6bb

Please sign in to comment.