3.1.0
版本发布时间: 2024-03-26 00:44:32
WordPress/WordPress-Coding-Standards最新发布版本:3.1.0(2024-03-26 00:44:32)
Added
- WordPress-Core ruleset: now includes the
Universal.PHP.LowercasePHPTag
sniff. - WordPress-Extra ruleset: now includes the
Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence
and theUniversal.CodeAnalysis.NoDoubleNegative
sniffs. - The
sanitize_locale_name()
function to the list of known "escaping" functions. Props @Chouby - The
sanitize_locale_name()
function to the list of known "sanitize & unslash" functions. Props @Chouby
Changed
- The minimum required
PHP_CodeSniffer
version to 3.9.0 (was 3.7.2). - The minimum required
PHPCSUtils
version to 1.0.10 (was 1.0.8). - The minimum required
PHPCSExtra
version to 1.2.1 (was 1.1.0). Please ensure you runcomposer update wp-coding-standards/wpcs --with-dependencies
to benefit from these updates. - Core ruleset: the spacing after the
use
keyword for closureuse
statements will now consistently be checked. Props @westonruter for reporting. - The default value for
minimum_wp_version
, as used by a number of sniffs detecting usage of deprecated WP features, has been updated to6.2
. -
WordPress.NamingConventions.PrefixAllGlobals
has been updated to recognize pluggable functions introduced in WP 6.4 and 6.5. -
WordPress.NamingConventions.ValidPostTypeSlug
has been updated to recognize reserved post types introduced in WP 6.4 and 6.5. -
WordPress.WP.ClassNameCase
has been updated to recognize classes introduced in WP 6.4 and 6.5. -
WordPress.WP.DeprecatedClasses
now detects classes deprecated in WordPress up to WP 6.5. -
WordPress.WP.DeprecatedFunctions
now detects functions deprecated in WordPress up to WP 6.5. - The
IsUnitTestTrait
will now recognize classes which extend the new WP CoreWP_Font_Face_UnitTestCase
class as test classes. - The test suite can now run on PHPUnit 4.x - 9.x (was 4.x - 7.x), which should make contributing more straight forward.
- Various housekeeping, includes a contribution from @rodrigoprimo.
Fixed
-
WordPress.WP.PostsPerPage
could potentially result in anInternal.Exception
when encountering a query string which doesn't include the value forposts_per_page
in the query string. Props @anomiex for reporting.