PluginProbe
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager / 0.0.3
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager v0.0.3
0.0.11 0.0.10 0.0.9 0.0.8 0.0.7 0.0.6 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5
cookiez / modules / settings / classes / route-base.php

route-base.php in Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager 0.0.3, at modules/settings/classes/route-base.php

41 lines 801 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Cookiez\Modules\Settings\Classes;
4
5 use Cookiez\Classes\Rest\Route;
6 use WP_REST_Response;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly
10 }
11
12 /**
13 * Class Route_Base
14 */
15 class Route_Base extends Route {
16 protected bool $override = false;
17 protected $auth = true;
18 protected string $path = '';
19 public function get_methods(): array {
20 return [];
21 }
22
23 public function get_endpoint(): string {
24 return 'settings/' . $this->get_path();
25 }
26
27 public function get_path(): string {
28 return $this->path;
29 }
30
31 public function get_name(): string {
32 return '';
33 }
34
35 public function get_permission_callback( \WP_REST_Request $request ): bool {
36 $valid = $this->permission_callback( $request );
37
38 return $valid && user_can( $this->current_user_id, 'manage_options' );
39 }
40 }
41