🔖 CS: whitelist two global variable overrides
The one in `functions.php` can be considered a bug in WPCS and has been reported as such. Once that issue is fixed, the whitelisting can be removed. The one in `inc/wpcom.php` will need to remain as WPCS does not keep track of globals introduced by wpcom.
This commit is contained in:
parent
7c24fc751d
commit
54ad32a598
2 changed files with 5 additions and 0 deletions
|
@ -91,6 +91,9 @@ add_action( 'after_setup_theme', '_s_setup' );
|
|||
* @global int $content_width
|
||||
*/
|
||||
function _s_content_width() {
|
||||
// This variable is intended to be overruled from themes.
|
||||
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
|
||||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
|
||||
$GLOBALS['content_width'] = apply_filters( '_s_content_width', 640 );
|
||||
}
|
||||
add_action( 'after_setup_theme', '_s_content_width', 0 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue