2012-11-06 24 views
0

我想從CF7提交自動發佈到我的網站上的「發佈」或「頁面」。自動發送到「發佈」或「頁面」Wordpress插件聯繫表7

我看到有必要添加一些動作鉤子,但我沒有這樣的技能?有人可以幫我嗎?

謝謝!

編輯:我可以用Blog_by_Email服務(發送提交到某個電子郵件,然後自動發帖),但我需要在帖子上的用戶ID。

回答

0

可以使用wp_insert_post以獲取更多信息做到這一點

//sample code 
if(isset($_POST['submit_button'])){ 
    $my_post = array(
    'post_title' => $_POST['title'], 
    'post_date' => date("Y-m-d H:i:s"), 
    'post_content' => $_POST['description'], 
    'post_status' => 'pending', 
    'post_type' => 'post', 
    'post_author' => $user_id 
    ); 
$the_post_id = wp_insert_post($my_post); 
} 

約wp_insert_post訪問此頁面http://codex.wordpress.org/Function_Reference/wp_insert_post

+0

不要緊,凡在WP-包括/ post.php中我把它? –

+0

你可以發佈它在你的模板 – loQ

+0

我可以改變任何東西..我不太明白,對不起。你能解釋一下嗎 –

相關問題