<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Simple hook loader to manage actions & filters
 */
class Trendly_AI_Post_Loader {
    protected $actions = [];
    protected $filters = [];

    public function add_action( string $hook, $component, string $callback, int $priority = 10, int $accepted_args = 1 ) : void {
        $this->actions[] = compact( 'hook', 'component', 'callback', 'priority', 'accepted_args' );
        add_action( $hook, [ $component, $callback ], $priority, $accepted_args );
    }

    public function add_filter( string $hook, $component, string $callback, int $priority = 10, int $accepted_args = 1 ) : void {
        $this->filters[] = compact( 'hook', 'component', 'callback', 'priority', 'accepted_args' );
        add_filter( $hook, [ $component, $callback ], $priority, $accepted_args );
    }
}
