Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/leadin/public/admin
File: class-gutenberg.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Leadin\admin;
[2] Fix | Delete
[3] Fix | Delete
use Leadin\AssetsManager;
[4] Fix | Delete
use Leadin\utils\Versions;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Contains all the methods used to initialize Gutenberg blocks.
[8] Fix | Delete
*/
[9] Fix | Delete
class Gutenberg {
[10] Fix | Delete
/**
[11] Fix | Delete
* Class constructor, register Gutenberg blocks.
[12] Fix | Delete
*/
[13] Fix | Delete
public function __construct() {
[14] Fix | Delete
if ( ! function_exists( 'register_block_type' ) ) {
[15] Fix | Delete
// Gutenberg is not active.
[16] Fix | Delete
return;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
add_action( 'init', array( $this, 'register_gutenberg_block' ) );
[20] Fix | Delete
add_filter( 'block_categories_all', array( $this, 'add_hubspot_category' ) );
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Add HubSpot category to Gutenberg blocks.
[25] Fix | Delete
*
[26] Fix | Delete
* @param Array $categories Array of block categories.
[27] Fix | Delete
*/
[28] Fix | Delete
public function add_hubspot_category( $categories ) {
[29] Fix | Delete
return array_merge(
[30] Fix | Delete
$categories,
[31] Fix | Delete
array(
[32] Fix | Delete
array(
[33] Fix | Delete
'slug' => 'leadin-blocks',
[34] Fix | Delete
'title' => __( 'HubSpot', 'leadin' ),
[35] Fix | Delete
),
[36] Fix | Delete
)
[37] Fix | Delete
);
[38] Fix | Delete
}
[39] Fix | Delete
/**
[40] Fix | Delete
* Register HubSpot Form Gutenberg block.
[41] Fix | Delete
*/
[42] Fix | Delete
public function register_gutenberg_block() {
[43] Fix | Delete
AssetsManager::localize_gutenberg();
[44] Fix | Delete
register_block_type(
[45] Fix | Delete
'leadin/hubspot-blocks',
[46] Fix | Delete
array(
[47] Fix | Delete
'editor_script' => AssetsManager::GUTENBERG,
[48] Fix | Delete
)
[49] Fix | Delete
);
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function