sohma
フォーラムへの返信
-
フォーラム: 使い方全般
返信が含まれるトピック: フロントエンドからカスタムフィールドへの画像投稿jim912さん
ありがとうございます。enctype 属性multipart/form-dataがあり、もし脆弱性を考えなかったとき、
単純に$mainimg = $_FILES["image"]; update_post_meta($id, 'mainimg',$mainimg);では投稿できないでしょうか?
フォーラム: 使い方全般
返信が含まれるトピック: 投稿ごとにコメントページを個別に設置する方法フォーラム: 使い方全般
返信が含まれるトピック: 投稿ごとにコメントページを個別に設置する方法okamotoさん
ご返事頂きありがとうございます!
はい、投稿するのは商品情報なのですが、投稿するたびにその投稿に対して一つ一つチャット形式の掲示板等のページを別ページで作りたいのですが、可能でしょうか?
フォーラム: 使い方全般
返信が含まれるトピック: 外部投稿フォームの確認画面KUCKLUさん
お疲れ様です!
すみません、知識不足なので、もう少し詳しく説明いただけないでしょうか?
すみませんがよろしくお願い致します(>_<)
フォーラム: 使い方全般
返信が含まれるトピック: 外部投稿フォームの確認画面フォーラム: 使い方全般
返信が含まれるトピック: wp_dropdown_categoriesを使ったタクソノミー一覧表示jim912さん
ありがとうございます!無事jim912さんのアドバイス通り、ソースを確認したところ,
selectのnameが間違っていました。とても助かりました!!本当にありがとうございます。
フォーラム: 使い方全般
返信が含まれるトピック: wp_dropdown_categoriesを使ったタクソノミー一覧表示jim912さん
ありがとうございます!!!
どうやら、array(intval($_POST[‘sellscategory’]))の部分がおかしいようです。
上手くタームを取得できていません。。。ここをタームのスタッグ、例えば’yasai’などにすると、ターム、野菜類が表示されます。
上記の記述は間違っているのでしょうか?
sellscategoryの部分はカスタムタクソノミーのスラッグ名でいいんでしょうか?
フォーラム: 使い方全般
返信が含まれるトピック: wp_dropdown_categoriesを使ったタクソノミー一覧表示フォーラム: 使い方全般
返信が含まれるトピック: wp_dropdown_categoriesを使ったタクソノミー一覧表示jim912さん
返信ありがとうございます。
なかなか解決しません。
フォーム側がおかしいのでしょうか?
『 <td><?php $args = array(
‘hide_empty’ => 0,
‘taxonomy’ => ‘sellscategory’,
); ?>
<?php wp_dropdown_categories( $args ); ?>
</td>』function側も載せます。
『function _my_sellsentry(){
global $sellsentry_error;
if(is_page(‘sellsentry2’)){
//フォームから送信されたかチェック
if(isset($_POST[‘_wpnonce’]) && wp_verify_nonce($_POST[‘_wpnonce’], ‘sellsentry_’.get_current_user_id())){
//ここまできたらセキュリティOK
if(!isset($_POST[‘title’]) || empty($_POST[‘title’])){
$sellsentry_error[] = ‘タイトルが空白です’;
}
//エラーが無かったら投稿を追加
if(empty($sellsentry_error)){
$id = wp_insert_post(array(
‘post_title’ => (string)$_POST[‘title’],
‘post_status’ => ‘publish’,
‘post_author’ => get_current_user_id(),
‘post_type’ => ‘sells’,
), true);//データの挿入に成功していたら移動
if(!is_wp_error($id)){
wp_set_object_terms($id, array(intval($_POST[‘sellscategory’])), ‘sellscategory’);
//カスタムフィールド追加
update_post_meta($id, ‘seisansya’, $_POST[‘seisansya’]);
update_post_meta($id, ‘teikyoujiki’, $_POST[‘hanjiki’]);
update_post_meta($id, ‘hanbairyou2’, $_POST[‘foo’]);
update_post_meta($id, ‘hanbairyou’, $_POST[‘hansize’]);
update_post_meta($id, ‘sekininsya’, $_POST[‘sekininsya’]);
update_post_meta($id, ‘kakaku2’, $_POST[‘ckaka’]);
update_post_meta($id, ‘kakaku’, $_POST[‘hankakaku’]);
update_post_meta($id, ‘seisanti’, $_POST[‘seisanti’]);
update_post_meta($id, ‘tane’, $_POST[‘tane’]);
update_post_meta($id, ‘taihi’, $_POST[‘taihi’]);
update_post_meta($id, ‘tokutyou2’, $_POST[‘tokutyou2’]);
update_post_meta($id, ‘tokutyou’, $_POST[‘tokutyou’]);
update_post_meta($id, ‘yuukoukigen’, $_POST[‘kigen’]);
update_post_meta($id, ‘keisaibi’, $_POST[‘keisaibi’]);
update_post_meta($id, ‘message’, $_POST[‘message’]);
update_post_meta($id, ‘adresszip1’, $_POST[‘zip1’]);
update_post_meta($id, ‘adresszip2’, $_POST[‘zip2’]);
update_post_meta($id, ‘adress1’, $_POST[‘prefecture’]);
update_post_meta($id, ‘adress2’, $_POST[‘address’]);
update_post_meta($id, ‘tell1’, $_POST[‘tell1’]);
update_post_meta($id, ‘tell2’, $_POST[‘tell2’]);
update_post_meta($id, ‘tell3’, $_POST[‘tell3’]);
update_post_meta($id, ‘fax1’, $_POST[‘fax1’]);
update_post_meta($id, ‘fax2’, $_POST[‘fax2’]);
update_post_meta($id, ‘fax3’, $_POST[‘fax3’]);
update_post_meta($id, ‘mail’, $_POST[‘email’]);
update_post_meta($id, ‘url’, $_POST[‘url’]);
update_post_meta($id, ‘sotial1’, $_POST[‘sotial1’]);
update_post_meta($id, ‘sotial2’, $_POST[‘sotial2’]);
update_post_meta($id, ‘time’, $_POST[‘eigyoujikan’]);
update_post_meta($id, ‘siharai’, $_POST[‘siharai’]);
update_post_meta($id, ‘cansel’, $_POST[‘cancel’]);
update_post_meta($id, ‘henpin’, $_POST[‘henpin’]);
update_post_meta($id, ‘haisou’, $_POST[‘method’]);
update_post_meta($id, ‘souryou2’, $_POST[‘souryou2’]);
update_post_meta($id, ‘souryou’, $_POST[‘souryou’]);
//ページを移動
header(‘Location: ‘.get_permalink($id));
die();
}else{
$create_wants_error[] = ‘エラーが発生しました’.$id->get_error_message();
}
}
}
}
} 』そして出力側です。
『 <div id=”selltable2″>
<h2><?php wp_title(”); ?></h2><p><span class=”hinsyu”><?php the_terms( $id, ‘sellscategory’ ); ?></span></p>
<h2>生産者:<?php echo post_custom(‘seisansya’); ?></h2> 』すみませんがよろしくお願い致します。
フォーラム: 使い方全般
返信が含まれるトピック: wp_dropdown_categoriesを使ったタクソノミー一覧表示