Add link to update WordPress when min version not met (https://github.com/woocommerce/woocommerce-admin/pull/5881)
* Add text to update WP if min version not met * Add disabled class if needs update
This commit is contained in:
parent
f3f6b31a49
commit
e2e1429acd
|
@ -263,6 +263,22 @@ class Loader {
|
|||
return $settings;
|
||||
}
|
||||
|
||||
$description = __(
|
||||
'Adds the new WooCommerce navigation experience to the dashboard',
|
||||
'woocommerce-admin'
|
||||
);
|
||||
$update_text = '';
|
||||
$needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' );
|
||||
if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||
$update_text = sprintf(
|
||||
/* translators: 1: line break tag, 2: open link to WordPress update link, 3: close link tag. */
|
||||
__( '%1$s %2$sUpdate WordPress to enable the new navigation%3$s', 'woocommerce-admin' ),
|
||||
'<br/>',
|
||||
'<a href="' . self_admin_url( 'update-core.php' ) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
return apply_filters(
|
||||
'woocommerce_settings_features',
|
||||
array(
|
||||
|
@ -274,9 +290,10 @@ class Loader {
|
|||
),
|
||||
array(
|
||||
'title' => __( 'Navigation', 'woocommerce-admin' ),
|
||||
'desc' => __( 'Adds the new WooCommerce navigation experience to the dashboard', 'woocommerce-admin' ),
|
||||
'desc' => $description . $update_text,
|
||||
'id' => 'woocommerce_navigation_enabled',
|
||||
'type' => 'checkbox',
|
||||
'class' => $needs_update ? 'disabled' : '',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
|
|
Loading…
Reference in New Issue