move updates to init hook because working with settings will get translation notice

This commit is contained in:
Daniel Hüsken 2024-11-27 13:12:46 +01:00
parent cb0fdfa461
commit 0e72db52fe
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8

View file

@ -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(