WC_Install::installpublic staticWC 1.0

Install WC.

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

Возвращает

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

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

$result = WC_Install::install();

Код WC_Install::install() WC 10.7.0

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

	// Create a lock to prevent multiple installs from running simultaneously.
	if ( ! self::create_lock() ) {
		return;
	}

	try {
		wc_maybe_define_constant( 'WC_INSTALLING', true );
		self::install_core();
	} finally {
		self::release_lock();
	}

	// 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' );
}