我在自定义php文件中使用wordpress函数,包括wp-load.php
, 从浏览器中运行可以,但从命令行中运行php /path/.php
wp-load.php
导致问题:
Warning: Cannot modify header information - headers already sent in /../wp-includes/ms-settings.php on line 162
要复制的代码示例:
echo \'something\';
require "/../wp-load.php";