<?php
/**
 * Customize comment form.
 *
 * @package kairo
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Remove website/URL field from comment form.
 *
 * This is a common practice for personal blogs to reduce spam
 * and simplify the comment experience. It does not break any
 * WordPress standards.
 *
 * @param array $fields Default comment form fields.
 * @return array Modified fields without URL field.
 */
function kairo_remove_comment_website_field( $fields ) {
	if ( isset( $fields['url'] ) ) {
		unset( $fields['url'] );
	}
	return $fields;
}
add_filter( 'comment_form_default_fields', 'kairo_remove_comment_website_field' );

/**
 * Customize comment form submit button text.
 *
 * @param array $defaults Default comment form arguments.
 * @return array Modified defaults.
 */
function kairo_comment_form_defaults( $defaults ) {
	$defaults['label_submit'] = __( 'Post Comment', 'kairo' );
	$defaults['title_reply']  = __( 'Leave a Comment', 'kairo' );
	/* translators: %s: Author name. */
	$defaults['title_reply_to'] = __( 'Reply to %s', 'kairo' );
	return $defaults;
}
add_filter( 'comment_form_defaults', 'kairo_comment_form_defaults' );

