プログラムを実行するとある内容の記事が自動でWordPressに投稿されます。
<?php
require('wp-blog-header.php'); //WordPressの関数を使用するため。ファイルの位置に注意。
$content = 'オリーブ'; //本文の中身
$post = array(
'post_author' =>1, //ユーザーID
'post_content' => $content,
'post_status' => 'publish', //公開か下書きか設定可能。
'post_title' => '最近食べたいもの', //タイトル
);
$postid = wp_insert_post($post); //この関数で投稿します。
?>


