BaseController.php
30 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Base controller class |
| 4 | * |
| 5 | * @package Tutor\GDPR\Controllers |
| 6 | * @author Themeum <support@themeum.com> |
| 7 | * @link https://themeum.com |
| 8 | * @since 4.0.0 |
| 9 | */ |
| 10 | |
| 11 | namespace Tutor\GDPR\Controllers; |
| 12 | |
| 13 | /** |
| 14 | * Base controller for the consent controllers |
| 15 | */ |
| 16 | class BaseController { |
| 17 | |
| 18 | /** |
| 19 | * Validate nonce and user capability for AJAX requests. |
| 20 | * |
| 21 | * @since 4.0.0 |
| 22 | * |
| 23 | * @return void |
| 24 | */ |
| 25 | protected function validate_ajax_request() { |
| 26 | tutor_utils()->check_nonce(); |
| 27 | tutor_utils()->check_current_user_capability(); |
| 28 | } |
| 29 | } |
| 30 |