: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Saltus\WP\Plugin\Saltus\InteractiveMaps\Plugin\Utils;
use Saltus\WP\Plugin\Saltus\InteractiveMaps\Plugin\MapList;
* Manage Assets like scripts and styles.
public function __construct( $core ) {
$this->register_shortcode();
public function register_shortcode() {
add_shortcode( 'map-title-current', array( $this, 'render_map_current_title' ) );
public function render_map_current_title( $atts ) {
$title = $this->get_current();
/* translators: %s is the name of the current map displaying */
$html = sprintf( __( '%s Map Preview', 'interactive-geo-maps' ), $title );
$html = __( 'World Map Preview', 'interactive-geo-maps' );
return sprintf( '<h2>%s</h2>', $html );
public function get_current() {
$value = isset( $_GET['map'] ) ? sanitize_text_field( $_GET['map'] ) : '';
$map_list = new MapList();
$options = json_decode( $map_list->maps, true );
if ( is_array( $options ) && ! empty( $options ) ) {
foreach ( $options as $option_key => $option ) {
if ( is_array( $option ) && ! empty( $option ) ) {
foreach ( $option as $sub_key => $sub_value ) {
if ( $value === $sub_key ) {