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

<?php

namespace Hostinger\EasyOnboarding;

defined( 'ABSPATH' ) || exit;

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

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

    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 );
    }

    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 );
    }


    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: 8 × Files: 14

Name Size Perms Modified Actions
Admin DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
Cli DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
Dto DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
Preview DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
Requests DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
Rest DIR
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
- drwxr-xr-x 2026-06-14 00:11:45
Edit Download
811 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
3.33 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
737 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
869 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
151 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
912 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
975 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
1.23 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
17.63 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
11.41 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
419 B lrw-r--r-- 2026-06-10 16:30:23
Edit Download
1.77 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
2.62 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download
1.54 KB lrw-r--r-- 2026-06-10 16:30:23
Edit Download

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