From 684324f5c0052273fdc0b95b6662cf0d8fb9a99c Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Tue, 5 Nov 2024 18:42:18 +0200 Subject: [PATCH] * reviewed; --- includes/core/class-blocks.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/core/class-blocks.php b/includes/core/class-blocks.php index e37830f8..fa2795fe 100644 --- a/includes/core/class-blocks.php +++ b/includes/core/class-blocks.php @@ -17,9 +17,8 @@ if ( ! class_exists( 'um\core\Blocks' ) ) { * Blocks constructor. */ public function __construct() { -// add_action( 'init', array( &$this, 'block_editor_render' ) ); + add_action( 'init', array( &$this, 'block_editor_render' ), 11 ); add_filter( 'block_type_metadata_settings', array( &$this, 'block_type_metadata_settings' ), 9999, 2 ); - add_action( 'init', array( &$this, 'wp_register_block_metadata_collection' ), 11 ); } /** @@ -69,8 +68,9 @@ if ( ! class_exists( 'um\core\Blocks' ) ) { * Register UM Blocks. * * @uses register_block_type_from_metadata() + * @uses wp_register_block_metadata_collection() */ - public function wp_register_block_metadata_collection() { + public function block_editor_render() { /** * Filters the variable to disable adding UM Blocks to Gutenberg editor. * @@ -100,10 +100,9 @@ if ( ! class_exists( 'um\core\Blocks' ) ) { return; } - wp_register_block_metadata_collection( - UM_PATH . 'build', - UM_PATH . 'build/blocks-manifest.php' - ); + if ( function_exists( 'wp_register_block_metadata_collection' ) ) { + wp_register_block_metadata_collection( UM_PATH . 'build', UM_PATH . 'build/blocks-manifest.php' ); + } $blocks = array( 'um-block/um-member-directories' => array(