PHP 8.0.30
Preview: Loader.php Size: 2.37 KB
/home/certprox/template.certproxywizard.com/wp-content/plugins/hostinger/includes/Loader.php

<?php

namespace Hostinger;

defined( 'ABSPATH' ) || exit;

class Loader {
    protected array $actions;
    protected array $filters;

    public function __construct() {
        $this->actions = array();
        $this->filters = array();
    }

    /**
     * @param string $hook
     * @param mixed  $component
     * @param string $callback
     * @param int    $priority
     * @param int    $accepted_args
     *
     * @return void
     */
    public function add_action( string $hook, $component, string $callback, int $priority = 10, int $accepted_args = 1 ) {
        $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
    }

    /**
     * @param string $hook
     * @param mixed  $component
     * @param string $callback
     * @param int    $priority
     * @param int    $accepted_args
     *
     * @return void
     */
    public function add_filter( string $hook, $component, string $callback, int $priority = 10, int $accepted_args = 1 ) {
        $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
    }

    /**
     * @param array  $hooks
     * @param string $hook
     * @param mixed  $component
     * @param string $callback
     * @param int    $priority
     * @param int    $accepted_args
     *
     * @return array
     */
    private function add(
        array $hooks,
        string $hook,
        $component,
        string $callback,
        int $priority,
        int $accepted_args
    ): array {
        $hooks[] = array(
            'hook'          => $hook,
            'component'     => $component,
            'callback'      => $callback,
            'priority'      => $priority,
            'accepted_args' => $accepted_args,
        );

        return $hooks;
    }

    /**
     * @return void
     */
    public function run(): void {
        foreach ( $this->filters as $hook ) {
            add_filter(
                $hook['hook'],
                array( $hook['component'], $hook['callback'] ),
                $hook['priority'],
                $hook['accepted_args']
            );
        }

        foreach ( $this->actions as $hook ) {
            add_action(
                $hook['hook'],
                array( $hook['component'], $hook['callback'] ),
                $hook['priority'],
                $hook['accepted_args']
            );
        }
    }
}

Directory Contents

Dirs: 6 × Files: 13

Name Size Perms Modified Actions
Admin DIR
- drwxr-xr-x 2026-06-14 00:11:50
Edit Download
Cli DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
Mcp DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
Rest DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
Views DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
734 B lrw-r--r-- 2026-06-10 16:30:25
Edit Download
2.62 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
814 B lrw-r--r-- 2026-06-10 16:30:25
Edit Download
2.65 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
136 B lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.68 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.29 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
5.15 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
5.13 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.13 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
389 B lrw-r--r-- 2026-06-10 16:30:25
Edit Download
2.37 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
2.61 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).