I have a custom post type called debate and I want to create some custom fields just on this post type. So, I have this code:
function debate_comment_fields( $fields ) {
if( is_singular( 'debate' ) ) {
unset($fields['url']);
unset($fields['author']);
unset($fields['email']);
$fields['options'] = '<p class="comment-form-options"><label for="options">' . __( 'I want to' ) . '</label>' .
'<input id="first" name="category" type="radio" value="' . get_post_meta(get_the_ID(), 'agree', true) .'" />'.
'<input id="second" name="category" type="radio" value="' . get_post_meta(get_the_ID(), 'disagree', true) .'" /></p>';
return $fields;
}
}
add_filter('comment_form_default_fields','debate_comment_fields');
Everything is ok on my custom post type, but on the default blog post type the author,email and url are not displayed.
Any idea why?