使用cron job运行PHP export_wp脚本以导出帖子的XML

时间:2016-06-02 20:23:35

标签: php xml wordpress cron

我想运行一个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);
}
?>

思想?

0 个答案:

没有答案