AnonSec Team
Server IP : 10.131.40.8  /  Your IP : 216.73.216.37
Web Server : Apache
System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : ludmqhh ( 137773)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/ludmqhh/www/guillaume/wp-content/plugins/spotlight-social-photo-feeds/modules/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/ludmqhh/www/guillaume/wp-content/plugins/spotlight-social-photo-feeds/modules/AdminModule.php
<?php

declare(strict_types=1);

namespace RebelCode\Spotlight\Instagram\Modules;

use Dhii\Services\Factories\Value;
use Psr\Container\ContainerInterface;
use RebelCode\Spotlight\Instagram\Module;

class AdminModule extends Module
{
    public function run(ContainerInterface $c): void
    {
        add_filter('plugin_action_links', function ($actions, $plugin) use ($c) {
            if (slInstaPluginInfo($plugin) !== null) {
                $idx = array_search('network_active', array_keys($actions));
                $newActions = $c->get('admin/plugin_row_actions');

                if ($idx === false) {
                    $actions = array_merge($newActions, $actions);
                } else {
                    array_splice($actions, $idx + 1, 0, $newActions);
                }
            }

            return $actions;
        }, 100, 2);

        add_filter('plugin_row_meta', function ($links, $plugin) use ($c) {
            if (slInstaPluginInfo($plugin) !== null) {
                $links = array_merge($links, $c->get('admin/plugin_meta_links'));
            }

            return $links;
        }, 100, 2);
    }

    public function getFactories(): array
    {
        return [
            'admin/plugin_row_actions' => new Value([
                'feeds' => sprintf(
                    '<a href="%s" aria-label="%s">%s</a>',
                    admin_url('admin.php?page=spotlight-instagram'),
                    esc_attr(__('Feeds', 'sl-insta')),
                    __('Feeds', 'sl-insta')
                ),
            ]),
            'admin/plugin_meta_links' => new Value([
                'docs' => sprintf(
                    '<a href="%s" aria-label="%s" target="_blank">%s</a>',
                    'https://docs.spotlightwp.com',
                    esc_attr(__('Docs & FAQs', 'sl-insta')),
                    __('Docs & FAQs', 'sl-insta')
                ),
            ]),
        ];
    }
}

AnonSec - 2021