43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* WordPress Hooks Registration
|
|
*
|
|
* Registers all WordPress hooks for synchronization
|
|
*
|
|
* @package Igny8Bridge
|
|
*/
|
|
|
|
// Prevent direct access
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
// Load sync class
|
|
require_once IGNY8_BRIDGE_PLUGIN_DIR . 'sync/post-sync.php';
|
|
|
|
/**
|
|
* Register WordPress hooks for IGNY8 sync
|
|
*/
|
|
function igny8_register_sync_hooks() {
|
|
// WordPress → IGNY8 hooks
|
|
add_action('save_post', 'igny8_sync_post_status_to_igny8', 10, 3);
|
|
add_action('publish_post', 'igny8_update_keywords_on_post_publish', 10, 1);
|
|
add_action('publish_page', 'igny8_update_keywords_on_post_publish', 10, 1);
|
|
add_action('draft_to_publish', 'igny8_update_keywords_on_post_publish', 10, 1);
|
|
add_action('future_to_publish', 'igny8_update_keywords_on_post_publish', 10, 1);
|
|
add_action('transition_post_status', 'igny8_sync_post_status_transition', 10, 3);
|
|
|
|
// Cron hooks
|
|
add_action('igny8_sync_post_statuses', 'igny8_cron_sync_post_statuses');
|
|
add_action('igny8_sync_site_data', 'igny8_cron_sync_site_data');
|
|
add_action('igny8_sync_from_igny8', 'igny8_cron_sync_from_igny8');
|
|
add_action('igny8_sync_taxonomies', 'igny8_cron_sync_taxonomies');
|
|
add_action('igny8_sync_keywords', 'igny8_cron_sync_keywords');
|
|
add_action('igny8_full_site_scan', 'igny8_cron_full_site_scan');
|
|
add_action('igny8_sync_site_structure', 'igny8_sync_site_structure_to_backend');
|
|
}
|
|
|
|
// Register hooks
|
|
igny8_register_sync_hooks();
|
|
|