- Added class-formidable.php to autoload in main plugin file - Hooked setup_registration_hooks() to init action - Added missing class-roles.php and class-acf-fields.php to autoload - Ensures Formidable integration runs after Formidable Forms loads Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Main plugin class
|
|
*
|
|
* @package DDHH_Job_Manager
|
|
*/
|
|
|
|
// Exit if accessed directly.
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* Main plugin class - Singleton
|
|
*/
|
|
class DDHH_JM_Job_Manager {
|
|
|
|
/**
|
|
* Single instance of the class
|
|
*
|
|
* @var DDHH_JM_Job_Manager
|
|
*/
|
|
private static $instance = null;
|
|
|
|
/**
|
|
* Get singleton instance
|
|
*
|
|
* @return DDHH_JM_Job_Manager
|
|
*/
|
|
public static function get_instance() {
|
|
if ( null === self::$instance ) {
|
|
self::$instance = new self();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
/**
|
|
* Constructor - Private to enforce singleton
|
|
*/
|
|
private function __construct() {
|
|
$this->init_hooks();
|
|
}
|
|
|
|
/**
|
|
* Initialize hooks
|
|
*/
|
|
private function init_hooks() {
|
|
// Register activation and deactivation hooks
|
|
register_activation_hook( DDHH_JM_PLUGIN_FILE, array( 'DDHH_JM_Activator', 'activate' ) );
|
|
register_deactivation_hook( DDHH_JM_PLUGIN_FILE, array( 'DDHH_JM_Deactivator', 'deactivate' ) );
|
|
|
|
// Initialize post types
|
|
add_action( 'init', array( 'DDHH_JM_Post_Types', 'register' ) );
|
|
|
|
// Initialize ACF fields
|
|
add_action( 'acf/init', array( 'DDHH_JM_ACF_Fields', 'register_fields' ) );
|
|
|
|
// Initialize Formidable Forms integration
|
|
add_action( 'init', array( 'DDHH_JM_Formidable', 'setup_registration_hooks' ) );
|
|
}
|
|
}
|