Add body class and change styles
This commit is contained in:
parent
fc30f3c036
commit
dfee6ab2e4
|
@ -637,7 +637,7 @@ mark.amount {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.woocommerce-help-tip {
|
.woocommerce-help-tip {
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
|
@ -2167,7 +2167,7 @@ ul.wc_coupon_list_block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.widefat {
|
.widefat {
|
||||||
|
|
||||||
|
@ -4123,7 +4123,7 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.woocommerce {
|
.woocommerce {
|
||||||
|
|
||||||
|
@ -6694,7 +6694,7 @@ table.bar_chart {
|
||||||
min-width: 400px !important;
|
min-width: 400px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.select2-results {
|
.select2-results {
|
||||||
|
|
||||||
|
@ -6831,7 +6831,7 @@ table.bar_chart {
|
||||||
|
|
||||||
@each $name, $color in $wp_admin_colors {
|
@each $name, $color in $wp_admin_colors {
|
||||||
|
|
||||||
&-#{$name}.branch-5-3 {
|
&-#{$name}.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.select2-dropdown {
|
.select2-dropdown {
|
||||||
border-color: $color;
|
border-color: $color;
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ h3.jetpack-reasons {
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-2,
|
.branch-5-2,
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.location-input {
|
.location-input {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -1415,7 +1415,7 @@ p.jetpack-terms {
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-5-2,
|
.branch-5-2,
|
||||||
.branch-5-3 {
|
.wc-wp-version-gte-53 {
|
||||||
|
|
||||||
.wc-wizard-service-setting-stripe_create_account,
|
.wc-wizard-service-setting-stripe_create_account,
|
||||||
.wc-wizard-service-setting-ppec_paypal_reroute_requests {
|
.wc-wizard-service-setting-ppec_paypal_reroute_requests {
|
||||||
|
|
|
@ -33,6 +33,9 @@ class WC_Admin {
|
||||||
|
|
||||||
// Disable WXR export of schedule action posts.
|
// Disable WXR export of schedule action posts.
|
||||||
add_filter( 'action_scheduler_post_type_args', array( $this, 'disable_webhook_post_export' ) );
|
add_filter( 'action_scheduler_post_type_args', array( $this, 'disable_webhook_post_export' ) );
|
||||||
|
|
||||||
|
// Add body class for WP 5.3+ compatibility.
|
||||||
|
add_filter( 'admin_body_class', array( $this, 'include_admin_body_classes' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -306,6 +309,32 @@ class WC_Admin {
|
||||||
$args['can_export'] = false;
|
$args['can_export'] = false;
|
||||||
return $args;
|
return $args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Include admin classes.
|
||||||
|
*
|
||||||
|
* @since 4.1.1
|
||||||
|
*
|
||||||
|
* @param String $classes
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public function include_admin_body_classes( $classes ) {
|
||||||
|
|
||||||
|
// Add WP 5.3+ compatibility class.
|
||||||
|
if ( strpos( $classes, 'wc-wp-version-gte-53' ) !== false ) {
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
global $wp_version;
|
||||||
|
$version_parts = explode( '-', $wp_version );
|
||||||
|
$version = sizeof( $version_parts ) > 1 ? $version_parts[ 0 ] : $wp_version;
|
||||||
|
|
||||||
|
if ( $wp_version && version_compare( $version, '5.3', '>=' ) ) {
|
||||||
|
$classes .= ' wc-wp-version-gte-53';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new WC_Admin();
|
return new WC_Admin();
|
||||||
|
|
Loading…
Reference in New Issue