Skip to content

Conversation

@schlessera
Copy link
Member

@schlessera schlessera commented Aug 30, 2023

Auto-generated PR that updates WPCS to the latest v3 and then fixes all automatically fixable issues.

See wp-cli/wp-cli-tests#175

@schlessera schlessera requested a review from a team as a code owner August 30, 2023 13:59
@schlessera schlessera added the scope:testing Related to testing label Aug 30, 2023
Comment on lines -510 to -545

/**
* Internalized version of global_terms_enabled() to get around a bug in WordPress Core.
*
* WP Core inadvertently removed the function instead of deprecating it during th 6.1 cycle.
*
* @see https://core.trac.wordpress.org/ticket/21734#comment:34
*/
function global_terms_enabled() {
if ( ! is_multisite() ) {
return false;
}

static $global_terms = null;
if ( is_null( $global_terms ) ) {

/**
* Filters whether global terms are enabled.
*
* Returning a non-null value from the filter will effectively short-circuit the function
* and return the value of the 'global_terms_enabled' site option instead.
*
* @since 3.0.0
*
* @param null $enabled Whether global terms are enabled.
*/
$filter = apply_filters( 'global_terms_enabled', null ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
if ( ! is_null( $filter ) ) {
$global_terms = (bool) $filter;
} else {
$global_terms = (bool) get_site_option( 'global_terms_enabled', false );
}
}

return $global_terms;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to remove this again, as it was only needed for WP 6.1 Beta 1 and fixed for the final WP 6.1 release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swissspidy swissspidy added this to the 2.9.0 milestone Aug 30, 2023
@swissspidy swissspidy merged commit ee2be5a into main Aug 30, 2023
@swissspidy swissspidy deleted the fix/wpcs-3.0-issues branch August 30, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants