[英]WooCommerce - Stop redirect to welcome screen upon plugin activation
You could try this instead:你可以试试这个:
add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
Same effect using an existing filter.使用现有过滤器的效果相同。
Okay, I figured it out.好吧,我想通了。 If anyone else needs help with this the code is below.
如果其他人需要帮助,代码如下。
//Old Solution: Stop WooCommerce redirect on activation
// function woocommerce_no_redirect_on_activation() {
// delete_transient( '_wc_activation_redirect' );
// };
// add_action( 'init', 'woocommerce_no_redirect_on_activation');
Edit: anikitas answer is better.编辑:anikitas 的答案更好。 I accepted their answer as the best solution:
我接受了他们的答案作为最佳解决方案:
//Stop WooCommerce redirect on activation
add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.