我试图找出如何在WordPress安装之外利用WP\\u Query和WP\\u Meta\\u Query来执行服务器Cron作业。
我试过包括wp-load.php
但这也带来了像WooCommerce这样的插件,我得到了各种各样的标题警告,等等。我只需要与数据库交互,而不是所有的主题和插件方法。
这是我当前收到的警告的一个示例:
Notice: wp_woocommerce_session_d34eac23ade02d0820a9089e923eed79 cookie cannot be set - headers already sent by /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-content/plugins/woo-product-slider/main.php on line 214 in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 733
Fatal error: Cannot redeclare get_query_var() (previously declared in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-includes/query.php:26) in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-includes/query.php on line 29