: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace EmbedPress\ThirdParty;
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
* Entity responsible for adding support for the Beaver Builder.
* @author EmbedPress <help@embedpress.com>
* @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
* @license GPLv3 or later
* Method that replaces the embed shortcodes, before Beaver calls WP's native embed shortcode.
* It forces that when it runs $wp_embed->run_shortcode.
public static function before_render_shortcodes($content)
// Back up current registered shortcodes and clear them all out
$orig_shortcode_tags = $shortcode_tags;
add_shortcode(EMBEDPRESS_SHORTCODE, ['\\EmbedPress\\Shortcode', 'do_shortcode']);
// Do the shortcode (only the [embed] one is registered)
$content = do_shortcode($content, true);
// Put the original shortcodes back
$shortcode_tags = $orig_shortcode_tags;