大家好我以下代码使用以下代码撰写报告:
$rp_options = array(
'broring' => 'This is really boring',
'difficult' => 'I don\'t understand this',
'great' => 'Great stuff, need more'
);
$mail_report_to = 'me@domain.com');
function createReportPostForm() {
global $rp_options, $post;
$html = '
<div id="formcont">
<h3>Report this article</h3>
<form id="myform">
<p>
<label for="name">What\'s wrong?</label>
<select name="report-msg" id="report-msg">
<option val="">...</option>';
foreach ($rp_options as $ok => $ov) {
$html .= '
<option val="'.$ok.'">'.$ov.'</option>';
}
$html .= '
</select>
<input type="hidden" name="posturl" value="'.get_permalink().'" />
<input type="hidden" name="action" value="ajax_action" />
<input type="button" value="Submit" id="submit_button" />
</p>
</form>
</div>
<div id="output"></div>';
return $html;
}
add_shortcode('rp-form', 'createReportPostForm');
http://www.web-development-blog.com/archives/wordpress-report-post/
我收到了表单,但它没有发送邮件,任何人都可以告诉我们在这段代码中错过了什么让它工作?感谢