WC_Install::install()public staticWC 1.0

Install WC.

Метод класса: WC_Install{}

Возвращает

null. Ничего (null).

Использование

$result = WC_Install::install();

Код WC_Install::install() WC 8.7.0

public static function install() {
	if ( ! is_blog_installed() ) {
		return;
	}

	// Check if we are not already running this routine.
	if ( self::is_installing() ) {
		return;
	}

	// If we made it till here nothing is running yet, lets set the transient now.
	set_transient( 'wc_installing', 'yes', MINUTE_IN_SECONDS * 10 );
	wc_maybe_define_constant( 'WC_INSTALLING', true );

	if ( self::is_new_install() && ! get_option( self::NEWLY_INSTALLED_OPTION, false ) ) {
		update_option( self::NEWLY_INSTALLED_OPTION, 'yes' );
	}

	WC()->wpdb_table_fix();
	self::remove_admin_notices();
	self::create_tables();
	self::verify_base_tables();
	self::create_options();
	self::migrate_options();
	self::create_roles();
	self::setup_environment();
	self::create_terms();
	self::create_cron_jobs();
	self::delete_obsolete_notes();
	self::create_files();
	self::maybe_create_pages();
	self::maybe_set_activation_transients();
	self::set_paypal_standard_load_eligibility();
	self::update_wc_version();
	self::maybe_update_db_version();
	self::maybe_set_store_id();

	delete_transient( 'wc_installing' );

	// Use add_option() here to avoid overwriting this value with each
	// plugin version update. We base plugin age off of this value.
	add_option( 'woocommerce_admin_install_timestamp', time() );

	// Force a flush of rewrite rules even if the corresponding hook isn't initialized yet.
	if ( ! has_action( 'woocommerce_flush_rewrite_rules' ) ) {
		flush_rewrite_rules();
	}

	/**
	 * Flush the rewrite rules after install or update.
	 *
	 * @since 2.7.0
	 */
	do_action( 'woocommerce_flush_rewrite_rules' );
	/**
	 * Run after WooCommerce has been installed or updated.
	 *
	 * @since 3.2.0
	 */
	do_action( 'woocommerce_installed' );
	/**
	 * Run after WooCommerce Admin has been installed or updated.
	 *
	 * @since 6.5.0
	 */
	do_action( 'woocommerce_admin_installed' );
}