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,15 +4353,14 @@ img.help_tip {
span { span {
display: block; display: block;
vertical-align: middle;
line-height: 24px; line-height: 24px;
}
span { .type_box {
display: inline; display: inline;
line-height: inherit; line-height: inherit;
vertical-align: baseline; vertical-align: baseline;
} }
}
select { select {
margin: 0; margin: 0;
@ -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. * Select2 colors for built-in admin color themes.
*/ */

View File

@ -27,7 +27,11 @@ jQuery( function( $ ) {
}); });
// Type box. // Type box.
if ( $( 'body' ).hasClass( 'wc-wp-version-gte-55' ) ) {
$( '.type_box' ).appendTo( '#woocommerce-product-data .hndle' );
} else {
$( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' ); $( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' );
}
$( function() { $( function() {
// Prevent inputs in meta box headings opening/closing contents. // Prevent inputs in meta box headings opening/closing contents.

View File

@ -331,6 +331,11 @@ class WC_Admin {
$classes .= ' wc-wp-version-gte-53'; $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; return $classes;
} }
} }