ElementGenerator
9 months ago
Ajax.php
10 months ago
Backend.php
1 year ago
Editor.php
1 year ago
Frontend.php
1 year ago
Helper.php
9 months ago
Hooks.php
9 months ago
Iframe.php
1 year ago
Pages.php
9 months ago
VisibilityCondition.php
8 months ago
Helper.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Preview script for html markup generator |
| 5 | * |
| 6 | * @package tutor-droip-elements |
| 7 | */ |
| 8 | |
| 9 | namespace TutorLMSDroip; |
| 10 | |
| 11 | use Droip\Ajax\ExportImport; |
| 12 | use TUTOR\Course; |
| 13 | |
| 14 | if (! defined('ABSPATH')) { |
| 15 | exit; // Exit if accessed directly. |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Class Helper |
| 20 | * This class is used to define all helper functions. |
| 21 | */ |
| 22 | class Helper |
| 23 | { |
| 24 | |
| 25 | |
| 26 | /** |
| 27 | * Function to activate droip elements plugin |
| 28 | */ |
| 29 | public static function t_d_e_activate() {} |
| 30 | |
| 31 | /** |
| 32 | * This function will verify nonce |
| 33 | * ACT like API calls auth middleware |
| 34 | * |
| 35 | * @param string $action ajax action name. |
| 36 | * |
| 37 | * @return void |
| 38 | */ |
| 39 | public static function verify_nonce($action = -1) |
| 40 | { |
| 41 | $nonce = sanitize_text_field(isset($_SERVER['HTTP_X_WP_NONCE']) ? wp_unslash($_SERVER['HTTP_X_WP_NONCE']) : null); |
| 42 | if (! wp_verify_nonce($nonce, $action)) { |
| 43 | wp_send_json_error('Not authorized'); |
| 44 | exit; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 |