HEX
Server: LiteSpeed
System: Linux server801.shared.spaceship.host 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: yvigantdvn (2232)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/yvigantdvn/petermkufya.com/wp-content/plugins/timetics/base/custom-endpoint.php
<?php
/**
 * Register Custom Endpoint
 *
 * @package Timetics
 */
namespace Timetics\Base;

defined( 'ABSPATH' ) || exit;

use Timetics\Utils\Singleton;

class Custom_Endpoint {
    use Singleton;

    /**
     * Initialize
     *
     * @return  void
     */
    public function init() {
        add_action( 'init', [$this, 'register'] );
    }

    /**
     * Register all custom endpoints
     *
     * @return  void
     */
    public function register() {
        $endpoints = $this->get_endpoints();

        foreach ( $endpoints as $endpoint ) {
            add_rewrite_endpoint( $endpoint, EP_ALL );
        }

        // Flush rewrite rules after register all custom endpoints.
        flush_rewrite_rules( true );
    }

    /**
     * Get all endpoints
     *
     * @return  array
     */
    public function get_endpoints() {
        /**
         * All endpoints that have to be register
         */
        return [
            'timetics-integration',
        ];
    }
};