/** * トークンを挿入 * * @param string $html * @return string */ public function mwform_form_end_html($html) { if (is_a($this->ExecShortcode, 'MW_WP_Form_Exec_Shortcode')) { $form_key = $this->ExecShortcode->get('key'); $html .= wp_nonce_field($form_key, $this->token_name, true, false); return $html; } }
/** * add_shortcode した後の ExecShortcode を返す * * @param string $view_flg * @return MW_WP_Form_Exec_Shortcode */ protected function get_ExecShortcode_after_add_shortcode($view_flg) { $post = $this->generate_page_has_mwform_formkey($this->Setting); $ExecShortcode = new MW_WP_Form_Exec_Shortcode($post, ''); $Form = new MW_WP_Form_Form(); $Data = MW_WP_Form_Data::getInstance($ExecShortcode->get('key')); $ExecShortcode->add_shortcode($view_flg, $this->Setting, $Form); $attributes = array('key' => $this->Setting->get('post_id')); $ExecShortcode->set_settings_by_mwform_formkey($attributes); return $ExecShortcode; }