Automattic\WooCommerce\Internal\EmailEditor
Integration::register_hooks
Register hooks for the integration.
Method of the class: Integration{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Integration = new Integration(); $Integration->register_hooks();
Integration::register_hooks() Integration::register hooks code WC 11.0.1
public function register_hooks() {
add_filter( 'woocommerce_email_editor_post_types', array( $this, 'add_email_post_type' ) );
add_filter( 'woocommerce_is_email_editor_page', array( $this, 'is_editor_page' ), 10, 1 );
add_filter( 'replace_editor', array( $this, 'replace_editor' ), 10, 2 );
add_filter( 'woocommerce_email_editor_send_preview_email_rendered_data', array( $this, 'update_send_preview_email_rendered_data' ), 10, 2 );
add_filter( 'woocommerce_email_editor_send_preview_email_personalizer_context', array( $this, 'update_send_preview_email_personalizer_context' ) );
add_filter( 'woocommerce_email_editor_preview_post_template_html', array( $this, 'update_preview_post_template_html_data' ), 100, 1 );
add_action( 'woocommerce_email_editor_send_preview_email_before_wp_mail', array( $this, 'send_preview_email_before_wp_mail' ), 10 );
add_action( 'woocommerce_email_editor_send_preview_email_after_wp_mail', array( $this, 'send_preview_email_after_wp_mail' ), 10 );
add_filter( 'woocommerce_email_editor_send_preview_email_subject', array( $this, 'update_email_subject_for_send_preview_email' ), 10, 2 );
add_action( 'rest_api_init', array( $this->email_api_controller, 'register_routes' ) );
// Priority 11 ensures the email editor's `init` bootstrap (default priority 10)
// has registered the `woo_email` post type before we register meta against it.
add_action( 'init', array( WCEmailTemplateDivergenceDetector::class, 'register_meta' ), 11 );
add_action( 'woocommerce_updated', array( WCEmailTemplateDivergenceDetector::class, 'run_sweep' ), 20 );
add_action( WCEmailTemplateSyncBackfill::BACKFILL_COMPLETE_ACTION, array( WCEmailTemplateDivergenceDetector::class, 'run_sweep' ), 10 );
// Fresh installs never cross the 10.8 db-update boundary, so the RSM-149
// backfill never runs and `BACKFILL_COMPLETE_OPTION` is never written.
// Stamp it from the `woocommerce_newly_installed` action so `run_sweep()`
// doesn't sit dormant forever on new sites.
add_action( 'woocommerce_newly_installed', array( WCEmailTemplateDivergenceDetector::class, 'mark_backfill_complete_on_fresh_install' ), 20 );
add_action( WCEmailTemplateAutoApplier::AUTO_APPLY_AS_HOOK, array( WCEmailTemplateAutoApplier::class, 'run' ), 10 );
add_action( 'woocommerce_email_template_divergence_sweep_complete', array( WCEmailTemplateAutoApplier::class, 'schedule' ), 10 );
// RSM-145 Tracks instrumentation: fire `_backfill_completed` once when the
// RSM-149 sync-meta backfill finalises. The backfill class itself is in the
// 10.8 feature freeze, so we hook the existing action it already publishes.
add_action( WCEmailTemplateSyncBackfill::BACKFILL_COMPLETE_ACTION, array( WCEmailTemplateSyncTracker::class, 'on_backfill_complete' ), 20 );
}