Add action for registering email templates

This commit introduces a new action to trigger registering email templates.
We need a custom action for that because the email editor engine controls
when we register templates and when we don't. Currently, we still skip
registering templates when we detect the site editor page.
[MAILPOET-6356]
This commit is contained in:
Rostislav Wolny
2024-12-16 14:50:08 +01:00
committed by Rostislav Wolný
parent e5aeae7989
commit 6eca06780f
2 changed files with 6 additions and 4 deletions

View File

@@ -56,10 +56,11 @@ We may add, update and delete any of them.
### Actions
| Name | Argument | Description |
|----------------------------------------|------------------|----------------------------------------------------------------------------------------------------|
| `mailpoet_email_editor_initialized` | `null` | Called when the Email Editor is initialized |
| `mailpoet_blocks_renderer_initialized` | `BlocksRegistry` | Called when the block content renderer is initialized. You may use this to add a new BlockRenderer |
| Name | Argument | Description |
|--------------------------------------------|------------------|------------------------------------------------------------------------------------------------------------------|
| `mailpoet_email_editor_initialized` | `null` | Called when the Email Editor is initialized |
| `mailpoet_blocks_renderer_initialized` | `BlocksRegistry` | Called when the block content renderer is initialized. You may use this to add a new BlockRenderer |
| `mailpoet_email_editor_register_templates` | | Called when the basic blank email template is registered. You can add more templates via register_block_template |
### Filters

View File

@@ -90,6 +90,7 @@ class Templates {
)
);
}
do_action( 'mailpoet_email_editor_register_templates' );
}
/**