URL、コードは以下の通りなのですが、保存時に一般設定の画面へ飛ばされ保存できません。どこが間違っていますか?
保存時のURL
options-general.php?wp_star%5Bpage%5D=1&save=変更を保存
保存箇所のコード
PHP
1 2 function admin_setting_form() { 3 $post_types = wp_list_filter( get_post_types(array('public'=>true)),array('attachment'), 'NOT' ); 4 ?> 5 <div class="wrap"> 6 <h2>Fivestar » <?php _e('Settings'); ?></h2> 7 <form id="<?php echo $this->text_domain; ?>" metho="post" action=""> 8 <?php //wp_nonce_field( 'fivestar-nonce-key', $this->text_domain ); ?> 9 <strong><?php _e('Enable on PostType'); ?></strong> 10 <?php 11 foreach ( $post_types as $post_type ) { 12 ?> 13 <p> 14 <strong><?php echo $post_type; ?>ページ上で有効にします</strong> 15 <input type="checkbox" name="<?php echo $this->text_domain; ?>[<?php echo $post_type; ?>]" value="1" <?php if( $this->text_domain[$post_type] == '1' ) echo 'checked'; ?> /> 16 </p> 17 <?php 18 } 19 ?> 20 </p> 21 <p class="submit"> 22 <input class="button-primary" type="submit" name='save' value='<?php _e('Save Changes') ?>' /> 23 </p> 24 </form> 25 </div> 26 <?php 27 } 28 // save 29 function admin_save_options() { 30 //if( checke_admin_referer( 'fivestar-nonce-key', $this->text_domain ) ) { 31 var_dump( $_POST[$this->text_domain] ); 32 if (isset($_POST['save'])) { 33 if (isset($_POST[$this->text_domain])) { 34 update_option($this->text_domain, $_POST[$this->text_domain]); 35 } 36 $this->message = __('Settings Updated.', $this->text_domain); 37 } 38 $this->options = get_option($this->text_domain); 39 40 update_option( $this->text_domain, $_POST[$this->text_domain] ); 41 $this->admin_setting_form(); 42 //wp_sage_redirect( menu_page_url( $this->text_domain, false ) ); 43 //} 44 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/08 14:24