Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/wpml-string-translationOLD/classes/Troubleshooting/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/wpml-string-translationOLD/classes/Troubleshooting/RequestHandle.php
<?php

namespace WPML\ST\Troubleshooting;

class RequestHandle implements \IWPML_Action {

	/** @var string $action */
	private $action;

	/** @var callable $callback */
	private $callback;

	public function __construct( $action, $callback ) {
		$this->action   = $action;
		$this->callback = $callback;
	}

	public function add_hooks() {
		add_action( 'wp_ajax_' . $this->action, [ $this, 'handle' ] );
	}

	public function handle() {
		if ( wp_verify_nonce( $_POST['nonce'], BackendHooks::NONCE_KEY ) ) {
			call_user_func( $this->callback );
			wp_send_json_success();
		} else {
			wp_send_json_error( 'Invalid nonce value', 500 );
		}
	}
}

Hry