Automattic\WooCommerce\Internal\Admin
Install::check_version()
Check WC Admin version and run the updater is required.
This check is done on all requests and runs if the versions do not match.
{} Это метод класса: Install{}
Хуки из метода
Возвращает
null
. Ничего.
Использование
$result = Install::check_version();
Код Install::check_version() Install::check version WC 6.4.1
public static function check_version() { if ( defined( 'IFRAME_REQUEST' ) ) { return; } $version_option = get_option( self::VERSION_OPTION ); $requires_update = version_compare( get_option( self::VERSION_OPTION ), WC_ADMIN_VERSION_NUMBER, '<' ); /* * When included as part of Core, no `on_activation` hook as been called * so there is no version in options. Make sure install gets called in this * case as well as a regular version update */ if ( ! $version_option || $requires_update ) { self::install(); /** * WooCommerce Admin has been installed or updated. */ do_action( 'woocommerce_admin_updated' ); if ( ! $version_option ) { /** * WooCommerce Admin has been installed. */ do_action( 'woocommerce_admin_newly_installed' ); } if ( $requires_update ) { /** * An existing installation of WooCommerce Admin has been * updated. */ do_action( 'woocommerce_admin_updated_existing' ); } } /* * Add the version option if none is found, as would be the case when * initialized via Core for the first time. */ if ( ! $version_option ) { add_option( self::VERSION_OPTION, WC_ADMIN_VERSION_NUMBER ); } }