我想运行一个cron作业来运行一个导出XML“post”的PHP脚本,但是我没有成功。这是我在的地方:
<?php
function haven_export_posts() {
$args=array(
'content' => 'posts',
'status' => 'published');
ob_start();
export_wp($args);
$xml = ob_get_clean();
file_put_contents( ABSPATH . 'path to directory/haven_export_posts.xml', $xml);
}
?>
思想?