Automattic\WooCommerce\Internal\EmailEditor
Integration::register_hooks
Register hooks for the integration.
Метод класса: Integration{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Integration = new Integration(); $Integration->register_hooks();
Код Integration::register_hooks() Integration::register hooks WC 11.1.2
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 );
// Postless send-preview: the listing "Send test email" action sends
// `emailType` instead of `postId` for emails without a published post.
// Priority 10 runs before the package's post-based handler (11).
add_filter( 'woocommerce_email_editor_send_preview_email', array( $this, 'send_preview_email_for_email_type' ), 10, 1 );
add_filter( 'woocommerce_email_editor_send_preview_email_without_post_permission', array( $this, 'authorize_postless_send_preview' ), 10, 2 );
// Listing Preview page for emails rendering from the file template.
add_action( 'admin_init', array( $this, 'render_block_email_preview_page' ) );
add_action( 'rest_api_init', array( $this->email_api_controller, 'register_routes' ) );
add_action( 'transition_post_status', array( $this, 'save_email_mapping_on_publish' ), 10, 3 );
// 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 );
}