Skip to content

Commit 8189aff

Browse files
authored
Merge pull request #2531 from rodrigoprimo/fix-valid-function-name-doc
NamingConventions/ValidFunctionName: update XML documentation
2 parents 20f3d5e + 9c8606e commit 8189aff

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

WordPress/Docs/NamingConventions/ValidFunctionNameStandard.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,28 @@ function <em>Prefix_Function_NAME()</em> {}
2424
<code title="Valid: Words separated by underscores.">
2525
<![CDATA[
2626
class My_Class {
27-
public static <em>method_name()</em> {}
27+
public static function <em>method_name()</em> {}
2828
}
2929
]]>
3030
</code>
3131
<code title="Invalid: Using camel case to separate words.">
3232
<![CDATA[
3333
class My_Class {
34-
public static <em>methodName()</em> {}
34+
public static function <em>methodName()</em> {}
3535
}
3636
]]>
3737
</code>
3838
</code_comparison>
39+
<code_comparison>
40+
<code title="Valid: Single underscore prefix is allowed.">
41+
<![CDATA[
42+
function <em>_prefix_function_name()</em> {}
43+
]]>
44+
</code>
45+
<code title="Invalid: Double underscore prefix is not allowed.">
46+
<![CDATA[
47+
function <em>__prefix_function_name()</em> {}
48+
]]>
49+
</code>
50+
</code_comparison>
3951
</documentation>

0 commit comments

Comments
 (0)