: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace EmbedPress\Providers;
use Embera\Provider\ProviderAdapter;
use Embera\Provider\ProviderInterface;
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
* Entity responsible to support Wrapper embeds.
* @subpackage EmbedPress/Providers
* @author EmbedPress <help@embedpress.com>
* @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
* @license GPLv3 or later
class X extends ProviderAdapter implements ProviderInterface
/** inline {@inheritdoc} */
protected $endpoint = 'https://publish.x.com/oembed?format=json';
/** inline {@inheritdoc} */
protected static $hosts = [
/** inline {@inheritdoc} */
protected $allowedParams = [
'maxwidth', 'maxheight', 'hide_media', 'hide_thread', 'omit_script', 'align',
'related', 'lang', 'theme', 'link_color', 'widget_type', 'dnt'
/** inline {@inheritdoc} */
protected $httpsSupport = true;
/** inline {@inheritdoc} */
protected $responsiveSupport = true;
/** inline {@inheritdoc} */
public function validateUrl(Url $url)
return (bool) (preg_match('~x\.com/(?:[^/]+)/(?:status|moments)/(?:[0-9]+)~i', (string) $url));
/** inline {@inheritdoc} */
public function normalizeUrl(Url $url)
$url->removeQueryString();