* reviewed;

This commit is contained in:
Mykyta Synelnikov
2024-11-05 18:42:18 +02:00
parent cf92a24168
commit 684324f5c0
+6 -7
View File
@@ -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(