WC_Install::check_version
Check WooCommerce version and run the updater is required.
This check is done on all requests and runs if the versions do not match.
Method of the class: WC_Install{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$result = WC_Install::check_version();
WC_Install::check_version() WC Install::check version code WC 10.3.3
public static function check_version() {
$wc_version = get_option( 'woocommerce_version' );
$wc_code_version = WC()->version;
$requires_update = version_compare( $wc_version, $wc_code_version, '<' );
if ( ! Constants::is_defined( 'IFRAME_REQUEST' ) && $requires_update ) {
self::install();
/**
* Run after WooCommerce has been updated.
*
* @since 2.2.0
*/
do_action( 'woocommerce_updated' );
do_action_deprecated( 'woocommerce_admin_updated', array(), $wc_code_version, 'woocommerce_updated' );
}
}