0
當有人進入「創建帖子頁面」(不更新帖子頁面)並預先填寫標題和正文字段時,是否有一種方法可以掛鉤?Hook pre create Post
喜歡的東西:
add_filter('WP_FILTER_ENTERS_CREATE_POST_PAGE', 'my_function_callback')
function my_function_callback() {
# dummy title
$title = 'My Post Tile';
# dummy post content
$post_body = '<p>Hi it is post body</p>';
# set editor content
wp_editor($postBody, 'my_editor_id'); // not sure
# set post title
???????
}
感謝提前:)
可能重複的[爲Wordpress自定義帖子類型設置默認標題?](http://stackoverflow.com/questions/20254827/set-default-title-for-wordpress-custom-post-types) – rnevius
我想填寫字段(標題和內容)當wp-admin/post-new.php加載不在用戶點擊提交按鈕後發佈.. –