本文整理匯總了PHP中WC_Install::install方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Install::install方法的具體用法?PHP WC_Install::install怎麽用?PHP WC_Install::install使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WC_Install
的用法示例。
在下文中一共展示了WC_Install::install方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _install_wc
function _install_wc()
{
WC_Install::install();
update_option('woocommerce_calc_shipping', 'yes');
// Needed for tests cart and shipping methods
// reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
$GLOBALS['wp_roles']->reinit();
}
示例2: _setup_theme
function _setup_theme()
{
define('WP_UNINSTALL_PLUGIN', true);
update_option('woocommerce_status_options', array('uninstall_data' => 1));
include dirname(__FILE__) . '/../vendor/woocommerce/uninstall.php';
WC_Install::install();
$GLOBALS['wp_roles']->reinit();
echo "Installing WooCommerce..." . PHP_EOL;
}
示例3: setup
public function setup()
{
update_option('woocommerce_taxjar-integration_settings', array('api_token' => $this->api_token, 'enabled' => 'yes', 'taxjar_download' => 'yes', 'store_zip' => '80111', 'store_city' => 'Greenwood Village', 'debug' => 'yes'));
update_option('woocommerce_default_country', 'US:CO');
update_option('woocommerce_calc_shipping', 'yes');
$wc_install = new WC_Install();
$wc_install->install();
do_action('plugins_loaded');
}
示例4: test_install
/**
* Test - install
*/
public function test_install()
{
// clean existing install first
if (!defined('WP_UNINSTALL_PLUGIN')) {
define('WP_UNINSTALL_PLUGIN', true);
}
include dirname(dirname(dirname(dirname(__FILE__)))) . '/uninstall.php';
\WC_Install::install();
$this->assertTrue(get_option('woocommerce_version') === WC()->version);
}
示例5: install_wc
/**
* Install WooCommerce after the test environment and WC have been loaded
*
* @since 2.2
*/
public function install_wc()
{
// clean existing install first
define('WP_UNINSTALL_PLUGIN', true);
include $this->plugin_dir . '/uninstall.php';
WC_Install::install();
// reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
$GLOBALS['wp_roles']->reinit();
echo "Installing WooCommerce..." . PHP_EOL;
}
示例6: install_wc
/**
* Install WooCommerce after the test environment and WC have been loaded
*
* @since 2.2
*/
public function install_wc()
{
// clean existing install first
define('WP_UNINSTALL_PLUGIN', true);
include $this->plugin_dir . '/uninstall.php';
WC_Install::install();
update_option('woocommerce_calc_shipping', 'yes');
// Needed for tests cart and shipping methods
// reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
$GLOBALS['wp_roles']->reinit();
echo "Installing WooCommerce..." . PHP_EOL;
}