本文整理汇总了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;
}