php
1if(!function_exists('wfu_after_file_upload_handler')) { 2function wfu_after_file_upload_handler($changable_data, $additional_data) { 3// Add code here... 4// 投稿オブジェクトを作成 5$my_post = array( 6'post_title' => 'My post', 7'post_content' => 'This is my post.', 8'post_status' => 'publish', 9'post_type' => 'page' 10); 11 12// 投稿をデータベースへ追加 13wp_insert_post( $my_post ); 14return $changable_data; 15} 16add_filter('wfu_after_file_upload', 'wfu_after_file_upload_handler', 10, 2); 17}
WordPress File Upload プラグイン編集のwordpress_file_upload.phpに上記のようなコードを書いて実行しました。しかし、サイトを訪れた人がファイルアップロードフォームからファイルをアップロードしたときに新しい固定ページが自動的に作成されません。どうしたらよいのでしょうか。
あなたの回答
tips
プレビュー