Merge pull request #27170 from woocommerce/fix/27167

Fixed - Fixed "Product type" dropdown from Product's data meta box on WP 5.5
This commit is contained in:
Claudio Sanches 2020-07-30 16:38:18 -03:00 committed by GitHub
commit 891a0cf8e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 7 deletions

View File

@ -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.
*/

View File

@ -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.

View File

@ -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;
}
}