この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので十分ご注意ください。
WordPressのお問い合わせフォームプラグイン Contact Form 7において[承諾確認]([acceptance])を設定すると、デフォルトでチェックボックスが改行されてしまいます。
やりたいことは
なのですが、どうしても
こうなっていまいます。
それを改善します。
■前提条件
WordPress 4.4.2
ContactForm7 4.3.1
■対処法
contact-form-7/modules/acceptance.php の
$html = sprintf( '<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>', sanitize_html_class( $tag->name ), $atts, $validation_error ); return $html;
この部分、この
<span class="wpcf7-form-control-wrap %1$s">・・・・・・・・・</span>
がクセモノです。これを除去します。
$html = sprintf( '<input %2$s />%3$s', sanitize_html_class( $tag->name ), $atts, $validation_error ); return $html;
これで改行されなくなりました。