Updated since tag and removed global variable
This commit is contained in:
parent
cb9dc9ed44
commit
224559e73f
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue