mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
move updates to init hook because working with settings will get translation notice
This commit is contained in:
parent
cb0fdfa461
commit
0e72db52fe
1 changed files with 21 additions and 16 deletions
|
@ -90,7 +90,9 @@ define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
|
|||
'plugins_loaded',
|
||||
function () {
|
||||
init();
|
||||
|
||||
add_action(
|
||||
'init',
|
||||
function () {
|
||||
$current_plugin_version = (string) PPCP::container()->get( 'ppcp.plugin' )->getVersion();
|
||||
$installed_plugin_version = get_option( 'woocommerce-ppcp-version' );
|
||||
if ( $installed_plugin_version !== $current_plugin_version ) {
|
||||
|
@ -107,6 +109,9 @@ define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
|
|||
}
|
||||
update_option( 'woocommerce-ppcp-version', $current_plugin_version );
|
||||
}
|
||||
},
|
||||
-1
|
||||
);
|
||||
}
|
||||
);
|
||||
register_activation_hook(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue