- Add DDHH_JM_ACF_Fields class with register_fields() method - Field group 'Job Details' for post_type job_offer - 6 fields: job_location (text, required), job_type (select, required), job_deadline (date_picker), job_contact_email (email, required), job_logo (image), job_deactivation_reason (textarea, conditional) - German labels: Standort, Art, Bewerbungsfrist, Kontakt-E-Mail, Logo - Logo returns ID for media library integration - Deactivation reason field shows only when status != publish - Hooked to 'acf/init' action
57 lines
1.1 KiB
PHP
57 lines
1.1 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' ) );
|
|
}
|
|
}
|