我在我的根 wordpress 文件夹中的一个名为 wp_insert_post.php 的文件中有以下代码但是当我从浏览器运行这个 url 时,我只得到一个空白页。没有任何 echo 语句出现。我究竟做错了什么?提前致谢!
<?php
require_once('wp-config.php');
error_reporting(E_ALL);
ini_set('display_errors',1);
echo "done1";
$post = array(
'ID' => []
'menu_order' => ['0']
'page_template' => []
'comment_status' => ['closed']
'ping_status' => ['open']
'pinged' => [] //?
'post_author' => ['1']
'post_category' => []
'post_content' => ['testautopage123']
'post_date' => ['2013-05-18 18:39:33']
'post_date_gmt' => ['2013-05-18 18:39:33']
'post_excerpt' => []
'post_name' => ['test-auto-page']
'post_parent' => []
'post_password' => []
'post_status' => ['publish']
'post_title' => ['Test Page']
'post_type' => ['page']
'tags_input' => []
'to_ping' => []);
echo "done2";
// Insert the post into the database
wp_insert_post($post);
echo "done3";
?>