Skip to content

Commit c1fcb19

Browse files
authored
Merge pull request #2468 from jrfnl/feature/docs-minor-consistency-tweaks
Documentation: various consistency fixes
2 parents 32fe3c4 + 0098653 commit c1fcb19

11 files changed

+36
-32
lines changed

WordPress/Docs/Arrays/ArrayIndentationStandard.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
>
66
<standard>
77
<![CDATA[
8-
The array closing bracket indentation should line up with the start of the content on the line containing the array opener.
8+
The array closing bracket indentation should line up with the start of the content on the line containing the array opener.
99
]]>
1010
</standard>
1111
<code_comparison>
12-
<code title="Valid: Closing bracket lined up correctly">
12+
<code title="Valid: Closing bracket lined up correctly.">
1313
<![CDATA[
1414
$args = array(
1515
'post_id' => 22,
1616
<em>);</em>
1717
]]>
1818
</code>
19-
<code title="Invalid: Closing bracket lined up incorrectly">
19+
<code title="Invalid: Closing bracket lined up incorrectly.">
2020
<![CDATA[
2121
$args = array(
2222
'post_id' => 22,
@@ -26,11 +26,11 @@ $args = array(
2626
</code_comparison>
2727
<standard>
2828
<![CDATA[
29-
In multi-line arrays, array items should be indented by a 4-space tab for each level of nested array, so that the array visually matches its structure.
29+
In multi-line arrays, array items should be indented by a 4-space tab for each level of nested array, so that the array visually matches its structure.
3030
]]>
3131
</standard>
3232
<code_comparison>
33-
<code title="Valid: Correctly indented array">
33+
<code title="Valid: Correctly indented array.">
3434
<![CDATA[
3535
$args = array(
3636
'post_id' => 22,
@@ -88,7 +88,7 @@ $args = array(
8888
</code>
8989
</code_comparison>
9090
<code_comparison>
91-
<code title="Valid: Opener and comma after closer are indented correctly">
91+
<code title="Valid: Opener and comma after closer are indented correctly.">
9292
<![CDATA[
9393
$text = array(
9494
<<<EOD

WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
>
66
<standard>
77
<![CDATA[
8-
When referring to array items, only include a space around the index if it is a variable or the key is concatenated.
8+
When referring to array items, only include a space around the index if it is a variable or the key is concatenated.
99
]]>
1010
</standard>
1111
<code_comparison>
12-
<code title="Valid: Correct spacing around the index keys">
12+
<code title="Valid: Correct spacing around the index keys.">
1313
<![CDATA[
1414
$post = $posts<em>[ </em>$post_id<em> ]</em>;
1515
$post_title = $post<em>[ </em>'concatenated' . $title<em> ]</em>;
@@ -18,7 +18,7 @@ $post = $posts<em>[</em>123<em>]</em>;
1818
$post_title = $post<em>[</em>'post_title'<em>]</em>;
1919
]]>
2020
</code>
21-
<code title="Invalid: Incorrect spacing around the index keys">
21+
<code title="Invalid: Incorrect spacing around the index keys.">
2222
<![CDATA[
2323
$post = $posts<em>[</em>$post_id<em>]</em>;
2424
$post_title = $post<em>[</em>'concatenated' . $title<em> ]</em>;

WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<standard>
77
<![CDATA[
8-
When declaring arrays, there should be one space on either side of a double arrow operator used to assign a value to a key.
8+
When declaring arrays, there should be one space on either side of a double arrow operator used to assign a value to a key.
99
]]>
1010
</standard>
1111
<code_comparison>
@@ -24,7 +24,7 @@ $bar = array( 'year'<em>=> </em>$current_year );
2424
</code_comparison>
2525
<standard>
2626
<![CDATA[
27-
In the case of a block of related assignments, it is recommended to align the arrows to promote readability.
27+
In the case of a block of related assignments, it is recommended to align the arrows to promote readability.
2828
]]>
2929
</standard>
3030
<code_comparison>

WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]]>
1616
</standard>
1717
<code_comparison>
18-
<code title="Valid: Using the prefix ECPT_">
18+
<code title="Valid: Using the prefix ECPT_.">
1919
<![CDATA[
2020
define( <em>'ECPT_VERSION'</em>, '1.0' );
2121
@@ -29,7 +29,7 @@ apply_filter(
2929
);
3030
]]>
3131
</code>
32-
<code title="Invalid: non-prefixed code">
32+
<code title="Invalid: non-prefixed code.">
3333
<![CDATA[
3434
define( <em>'PLUGIN_VERSION'</em>, '1.0' );
3535
@@ -45,7 +45,7 @@ apply_filter(
4545
</code>
4646
</code_comparison>
4747
<code_comparison>
48-
<code title="Valid: Using the prefix ECPT_ in namespaced code">
48+
<code title="Valid: Using the prefix ECPT_ in namespaced code.">
4949
<![CDATA[
5050
namespace <em>ECPT_Plugin\Admin</em>;
5151
@@ -68,7 +68,7 @@ apply_filter(
6868
);
6969
]]>
7070
</code>
71-
<code title="Invalid: using a non-prefixed namespace">
71+
<code title="Invalid: using a non-prefixed namespace.">
7272
<![CDATA[
7373
namespace <em>Admin</em>;
7474
@@ -88,12 +88,12 @@ class Admin_Page {}
8888
]]>
8989
</standard>
9090
<code_comparison>
91-
<code title="Valid: Using the prefix mycoolplugin_">
91+
<code title="Valid: Using the prefix mycoolplugin_.">
9292
<![CDATA[
9393
function <em>mycoolplugin_save_post()</em> {}
9494
]]>
9595
</code>
96-
<code title="Invalid: Using a WordPress reserved prefix wp_">
96+
<code title="Invalid: Using a WordPress reserved prefix wp_.">
9797
<![CDATA[
9898
function <em>wp_save_post()</em> {}
9999
]]>
@@ -105,12 +105,12 @@ function <em>wp_save_post()</em> {}
105105
]]>
106106
</standard>
107107
<code_comparison>
108-
<code title="Valid: Using the distinct prefix MyPlugin">
108+
<code title="Valid: Using the distinct prefix MyPlugin.">
109109
<![CDATA[
110110
interface <em>MyPluginIsCool</em> {}
111111
]]>
112112
</code>
113-
<code title="Invalid: Using a two-letter prefix My">
113+
<code title="Invalid: Using a two-letter prefix My.">
114114
<![CDATA[
115115
interface <em>My</em> {}
116116
]]>

WordPress/Docs/PHP/IniSetStandard.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<standard>
77
<![CDATA[
8-
Using ini_set() and similar functions for altering PHP settings at runtime is discouraged. Changing runtime configuration might break other plugins and themes, and even WordPress itself.
8+
Using ini_set() and similar functions for altering PHP settings at runtime is discouraged. Changing runtime configuration might break other plugins and themes, and even WordPress itself.
99
]]>
1010
</standard>
1111
<code_comparison>
@@ -22,7 +22,7 @@ ini_set( <em>'short_open_tag'</em>, 'off' );
2222
</code_comparison>
2323
<standard>
2424
<![CDATA[
25-
For some configuration values there are alternative ways available - either via WordPress native functionality of via standard PHP - to achieve the same without the risk of breaking interoperability. These alternatives are preferred.
25+
For some configuration values there are alternative ways available - either via WordPress native functionality of via standard PHP - to achieve the same without the risk of breaking interoperability. These alternatives are preferred.
2626
]]>
2727
</standard>
2828
<code_comparison>

WordPress/Docs/PHP/YodaConditionsStandard.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
]]>
1010
</standard>
1111
<code_comparison>
12-
<code title="Valid: The variable is placed on the right">
12+
<code title="Valid: The variable is placed on the right.">
1313
<![CDATA[
1414
if ( <em>true === $the_force</em> ) {
1515
$victorious = you_will( $be );
1616
}
1717
]]>
1818
</code>
19-
<code title="Invalid: The variable has been placed on the left">
19+
<code title="Invalid: The variable has been placed on the left.">
2020
<![CDATA[
2121
if ( <em>$the_force === false</em> ) {
2222
$victorious = you_will_not( $be );

WordPress/Docs/WP/CapabilitiesStandard.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<standard>
77
<![CDATA[
8-
Capabilities passed should be valid capabilities (custom capabilities can be added in the ruleset).
8+
Capabilities passed should be valid capabilities (custom capabilities can be added in the ruleset).
99
]]>
1010
</standard>
1111
<code_comparison>
@@ -22,7 +22,7 @@ map_meta_cap( <em>'manage_site'</em>, $user->ID );
2222
</code_comparison>
2323
<standard>
2424
<![CDATA[
25-
Always use user capabilities instead of roles.
25+
Always use user capabilities instead of roles.
2626
]]>
2727
</standard>
2828
<code_comparison>
@@ -51,7 +51,7 @@ add_options_page(
5151
</code_comparison>
5252
<standard>
5353
<![CDATA[
54-
Don't use deprecated capabilities.
54+
Don't use deprecated capabilities.
5555
]]>
5656
</standard>
5757
<code_comparison>

WordPress/Docs/WP/CapitalPDangitStandard.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
>
66
<standard>
77
<![CDATA[
8-
The correct spelling of "WordPress" should be used in text strings, comments and object names.
8+
The correct spelling of "WordPress" should be used in text strings, comments and object names.
99
10-
In select cases, when part of an identifier or a URL, WordPress does not have to be capitalized.
10+
In select cases, when part of an identifier or a URL, WordPress does not have to be capitalized.
1111
]]>
1212
</standard>
1313
<code_comparison>

WordPress/Docs/WP/DeprecatedParametersStandard.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<standard>
77
<![CDATA[
88
Please refrain from passing deprecated WordPress function parameters.
9-
In case, you need to pass an optional parameter positioned <em>after</em> the deprecated parameter, only ever pass the default value.
9+
In case, you need to pass an optional parameter positioned <em>after</em> the deprecated parameter, only ever pass the default value.
1010
]]>
1111
</standard>
1212
<code_comparison>

WordPress/Docs/WP/PostsPerPageStandard.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
>
66
<standard>
77
<![CDATA[
8-
Using "posts_per_page" or "numberposts" with the value set to an high number opens up the potential for making requests slow if the query ends up querying thousands of posts.
8+
Using "posts_per_page" or "numberposts" with the value set to an high number opens up the potential for making requests slow if the query ends up querying thousands of posts.
99
10-
You should always fetch the lowest number possible that still gives you the number of results you find acceptable.
10+
You should always fetch the lowest number possible that still gives you the number of results you find acceptable.
1111
]]>
1212
</standard>
1313
<code_comparison>

WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<documentation title="Object Operator Spacing">
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="Object Operator Spacing"
5+
>
26
<standard>
37
<![CDATA[
48
The object operators (->, ?->, ::) should not have any spaces around them, though new lines are allowed except for use with the `::class` constant.

0 commit comments

Comments
 (0)