<?php
/**
 * WordPress Filters Registration
 *
 * This file registers all WordPress filters for the Zeno Chatbot plugin.
 * Each filter is mapped to a handler class for clean separation of concerns.
 *
 * @package ZenoChatbot\Hooks
 */

use ZenoChatbot\Framework\Foundation\Application;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Register WordPress filters
 *
 * @param Application $app
 * @return void
 */
return function(Application $app) {
    add_filter('cron_schedules', function($schedules) {
        if (!is_array($schedules)) {
            $schedules = [];
        }

        if (!isset($schedules[\ZenoChatbot\Services\ConversationSummaryWatcher::FIVE_MINUTE_SCHEDULE])) {
            $schedules[\ZenoChatbot\Services\ConversationSummaryWatcher::FIVE_MINUTE_SCHEDULE] = [
                'interval' => 300,
                'display' => 'Every 5 Minutes (Zeno Chatbot)',
            ];
        }

        return $schedules;
    });
};
