Как изменить comment_form?

Добрый день.
Хочу обернуть поля (имя, емаил, сайт), вставлю этот код

comment_form( array(
		'fields'	=> array(
			'author' => '<div><p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
			'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . $html_req . ' /></p>',
			'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
			'<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
			'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
			'<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p></div>',
		),
	) );


выдает такие ошибки

Notice: Undefined variable: aria_req in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 86

Notice: Undefined variable: html_req in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 86

Notice: Undefined variable: html5 in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 88

Notice: Undefined variable: aria_req in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 88

Notice: Undefined variable: html_req in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 88

Notice: Undefined variable: html5 in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 90

на сайте Кама нашел, что нужно прописать это

$req      = get_option( 'require_name_email' );
	$html_req = ( $req ? " required='required'" : '' );
	$html5    = 'html5' === $args['format'];
	$aria_req = ( $req ? " aria-required='true'" : '' );
	$commenter = wp_get_current_commenter();


теперь выдает эту ошибку

Notice: Undefined variable: args in C:\OSPanel\domains\sky.loc\wp-content\themes\sky\comments.php on line 80

Подскажите, что еще сделать нужно?
  • Вопрос задан
  • 360 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы