Site icon Hip-Hop Website Design and Development

Changing the Comment Fields using Filter (without success)

Am I doing this all wrong or should this be working? No matter what post I visit, it’s thrown into an endless loop..

This is the code:

add_filter('comment_form_fields', 'comment_form_args');
function comment_form_args( $fields ) {

  if ( ! is_user_logged_in() ) {
    comment_form(array(
    'label_submit' => __('Submit for Approval'),
    'comment_notes_before' => '',
    'title_reply' => 'Need to ask something? Go ahead.',
    'title_reply_to' => 'Your reply to %s',
    'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( '', 'noun' ) . '</label><br /><textarea id="comment" name="comment" aria-required="true"></textarea></p>',
    'comment_notes_after' => '<p>Be polite and specific. Spam will be deleted.</p>'
    )
  );
  } else {

    comment_form(array(
    'label_submit' => __('Submit'),
    'comment_notes_before' => '',
    'title_reply' => '',
    'title_reply_to' => 'Answer %s',
    'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( '', 'noun' ) . '</label><br /><textarea id="comment" name="comment" aria-required="true"></textarea></p>',
    'comment_notes_after' => ''
    )
  );

  }
}