diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 8d8b4727694..4e6cc55ab3d 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -4353,14 +4353,13 @@ img.help_tip { span { display: block; - vertical-align: middle; line-height: 24px; + } - span { - display: inline; - line-height: inherit; - vertical-align: baseline; - } + .type_box { + display: inline; + line-height: inherit; + vertical-align: baseline; } select { @@ -6825,6 +6824,23 @@ table.bar_chart { } } +.wc-wp-version-gte-55 { + + #woocommerce-product-data { + + .hndle { + display: block; + line-height: 24px; + + .type_box { + display: inline; + line-height: inherit; + vertical-align: baseline; + } + } + } +} + /** * Select2 colors for built-in admin color themes. */ diff --git a/assets/js/admin/meta-boxes-product.js b/assets/js/admin/meta-boxes-product.js index efbae1dbf4d..d54284dd766 100644 --- a/assets/js/admin/meta-boxes-product.js +++ b/assets/js/admin/meta-boxes-product.js @@ -27,7 +27,11 @@ jQuery( function( $ ) { }); // Type box. - $( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' ); + if ( $( 'body' ).hasClass( 'wc-wp-version-gte-55' ) ) { + $( '.type_box' ).appendTo( '#woocommerce-product-data .hndle' ); + } else { + $( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' ); + } $( function() { // Prevent inputs in meta box headings opening/closing contents. diff --git a/includes/admin/class-wc-admin.php b/includes/admin/class-wc-admin.php index 6932f817ca5..8a9d6e8bd43 100644 --- a/includes/admin/class-wc-admin.php +++ b/includes/admin/class-wc-admin.php @@ -331,6 +331,11 @@ class WC_Admin { $classes .= ' wc-wp-version-gte-53'; } + // Add WP 5.5+ compatibility class. + if ( $raw_version && version_compare( $version, '5.5', '>=' ) ) { + $classes .= ' wc-wp-version-gte-55'; + } + return $classes; } }