Add notice when upgrading to plugin version >= 3.0.0

This commit is contained in:
George Burduli 2024-07-10 10:22:14 +04:00
parent 36a13f6500
commit 5123a1511c
No known key found for this signature in database
GPG key ID: 572A97DFDA3D2E5C

View file

@ -222,6 +222,22 @@ define( 'PAYPAL_INTEGRATION_DATE', '2024-06-25' );
} }
); );
add_action(
'in_plugin_update_message-woocommerce-paypal-payments/woocommerce-paypal-payments.php',
static function( array $plugin_data, \stdClass $new_data ) {
if ( version_compare( $plugin_data['Version'], '3.0.0', '<' ) &&
version_compare( $new_data->new_version, '3.0.0', '>=' ) ) {
printf(
'<div class="update-message"><p><strong>%s</strong>: %s</p></div>',
esc_html__( 'Warning', 'woocommerce-paypal-payments' ),
esc_html__( 'WooCommerce PayPal Payments version 3.0.0 contains significant changes that may impact your website. We strongly recommend reviewing the changes and testing the update on a staging site before updating it on your production environment.', 'woocommerce-paypal-payments' )
);
}
},
10,
2
);
/** /**
* Check if WooCommerce is active. * Check if WooCommerce is active.
* *