- payment : first date error corrected
- payment : added httpErrorException - payment : error handling wip - profil page restriction gives access to admin and editor
This commit is contained in:
30
plugins/fipfcard_plugin/php/utils/http_errors.php
Normal file
30
plugins/fipfcard_plugin/php/utils/http_errors.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
* it means someone outside wp is accessing the file, in this case kill it.
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die('You can not access this file!');
|
||||
}
|
||||
|
||||
|
||||
// Define a custom exception class for HTTP errors
|
||||
class HttpErrorException extends Exception {
|
||||
// HTTP status code
|
||||
private $statusCode;
|
||||
|
||||
public function __construct($message, $statusCode) {
|
||||
parent::__construct($message);
|
||||
$this->statusCode = $statusCode;
|
||||
}
|
||||
|
||||
public function getStatusCode() {
|
||||
return $this->statusCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user