| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www/wp-content/plugins/spotlight-social-photo-feeds/modules/ |
Upload File : |
<?php
namespace RebelCode\Spotlight\Instagram\Modules;
use RebelCode\Spotlight\Instagram\Module;
use RebelCode\Spotlight\Instagram\Actions\OEmbedHandler;
use Psr\Container\ContainerInterface;
use Dhii\Services\Factories\Value;
use Dhii\Services\Factories\Constructor;
class OEmbedModule extends Module
{
public function run(ContainerInterface $c): void
{
wp_embed_register_handler(
$c->get('id'),
$c->get('regex'),
$c->get('handler')
);
}
public function getFactories(): array
{
return [
// The ID of the handler
'id' => new Value('sl_instagram_embed'),
// The base URL to use to request embeds from Facebook's API
'url' => new Value('https://graph.facebook.com/v22.0/instagram_oembed'),
// The regex to match Instagram post URLs
'regex' => new Value('#https?://((m|www)\.)?instagram\.com/p/(.*)#i'),
// The handler function that creates the HTML string
'handler' => new Constructor(OEmbedHandler::class, [
'url',
'@ig/client',
'@accounts/cpt',
]),
];
}
}