MailPoet\EmailEditor\Engine
Email_Editor::register_block_templates()
Register block templates.
Method of the class: Email_Editor{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->register_block_templates(): void;
Email_Editor::register_block_templates() Email Editor::register block templates code WC 9.8.1
private function register_block_templates(): void { // Since we cannot currently disable blocks in the editor for specific templates, disable templates when viewing site editor. @see https://github.com/WordPress/gutenberg/issues/41062. if ( strstr( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) ), 'site-editor.php' ) === false ) { $post_types = array_column( $this->get_post_types(), 'name' ); $this->templates->initialize( $post_types ); } }