<?php
/**
 * Free Version Hooks Integration
 *
 * This class hooks into the Free version's User Directory module
 * to extend it with Pro features instead of completely replacing it.
 *
 * @package WPUF_Pro
 * @subpackage UserDirectory
 * @since 4.2.11
 */

namespace WPUF\UserDirectory;

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

/**
 * FreeModuleHooks Class
 *
 * Integrates Pro features by hooking into Free version filters and actions.
 * This provides a seamless upgrade path where Pro extends Free functionality.
 *
 * @since 4.2.11
 */
class FreeModuleHooks {

    /**
     * Singleton instance
     *
     * @var FreeModuleHooks|null
     */
    private static $instance = null;

    /**
     * Get singleton instance
     *
     * @since 4.2.11
     *
     * @return FreeModuleHooks
     */
    public static function get_instance() {
        if ( null === self::$instance ) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    /**
     * Constructor
     *
     * @since 4.2.11
     */
    private function __construct() {
        $this->init_hooks();
    }

    /**
     * Initialize all hooks
     *
     * These hooks tell the Free version to skip its functionality
     * so Pro can take over completely.
     *
     * @since 4.2.11
     *
     * @return void
     */
    private function init_hooks() {
        // Skip Free version admin components - Pro takes over
        add_filter( 'wpuf_ud_skip_free_admin_menu', '__return_true' );
        add_filter( 'wpuf_ud_skip_free_admin_scripts', '__return_true' );

        // Skip Free version shortcode - Pro has enhanced shortcode
        add_filter( 'wpuf_ud_skip_free_shortcode', '__return_true' );

        // Skip Free version pretty URLs - Pro has enhanced URL handling
        add_filter( 'wpuf_ud_skip_free_pretty_urls', '__return_true' );

        // Skip Free version limits - Pro unlocks all features
        add_filter( 'wpuf_ud_skip_free_limits', '__return_true' );

        // Skip Free post type registration - Pro handles it
        add_filter( 'wpuf_ud_skip_free_post_type', '__return_true' );
    }
}
