: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Saltus\WP\Plugin\Saltus\InteractiveMaps\Plugin\Blocks;
* Sets up the widgets name etc
public function __construct( $core ) {
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_assets' ) );
public function enqueue_block_assets(){
$this->core->name . '_blocks',
plugins_url( 'assets/block-styles.css', __FILE__ ),
wp_enqueue_style( $this->core->name . '_blocks' );
$this->core->name . '_map_block',
plugins_url( 'assets/mapBlock.js', __FILE__ ),
array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
'suppress_filters' => true,
$maps = get_posts( $args );
$object = (object) [ 'property' => 'Here we go' ];
/* translators: used in block editor when no map is selected. */
'label' => __( 'Please select a map', 'interactive-geo-maps' ),
foreach ( $maps as $map ) {
$meta = get_post_meta( $map->ID, 'map_info', true );
$height = isset( $meta['visual']['paddingTop'] ) ? $meta['visual']['paddingTop'] : '56.25';
$height = strpos( $height, '%' ) !== false ? str_replace( '%', '', $height ) : $height;
$max_width = isset( $meta['visual']['maxWidth'] ) && $meta['visual']['maxWidth'] !== '0' && $meta['visual']['maxWidth'] !== '' ? $meta['visual']['maxWidth'] : '2200';
$image_meta = get_post_meta( $map->ID, 'map_image', true );
$image = isset( $image_meta['mapImage'] ) && $image_meta['mapImage'] !== '' ? $image_meta['mapImage'] : '';
'label' => $map->post_title,
'maxWidth' => $max_width,
wp_localize_script( $this->core->name . '_map_block', 'igmMapBlockOptions', $map_options );