Updated since tag and removed global variable

This commit is contained in:
Claudio Sanches 2020-05-07 18:57:53 -03:00 committed by GitHub
parent cb9dc9ed44
commit 224559e73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -313,24 +313,21 @@ class WC_Admin {
/** /**
* Include admin classes. * Include admin classes.
* *
* @since 4.1.1 * @since 4.2.0
* * @param string $classes Body classes string.
* @param String $classes Body classes string. * @return string
*
* @return String
*/ */
public function include_admin_body_class( $classes ) { public function include_admin_body_class( $classes ) {
if ( false !== strpos( $classes, 'wc-wp-version-gte-53' ) ) { if ( false !== strpos( $classes, 'wc-wp-version-gte-53' ) ) {
return $classes; return $classes;
} }
global $wp_version; $raw_version = get_bloginfo( 'version' );
$version_parts = explode( '-', $wp_version ); $version_parts = explode( '-', $raw_version );
$version = count( $version_parts ) > 1 ? $version_parts[0] : $wp_version; $version = count( $version_parts ) > 1 ? $version_parts[0] : $raw_version;
// Add WP 5.3+ compatibility class. // Add WP 5.3+ compatibility class.
if ( $wp_version && version_compare( $version, '5.3', '>=' ) ) { if ( $raw_version && version_compare( $version, '5.3', '>=' ) ) {
$classes .= ' wc-wp-version-gte-53'; $classes .= ' wc-wp-version-gte-53';
} }