PluginProbe
Force Refresh / trunk
Force Refresh vtrunk
3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 2.12.1 All 53 releases
force-refresh / includes / api / classes / class-api-handler-admin.php

class-api-handler-admin.php in Force Refresh trunk, at includes/api/classes/class-api-handler-admin.php

35 lines 897 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Our API calls responsible for handling requests from admins requesting a refresh for the site.
4 *
5 * @package ForceRefresh
6 */
7
8 namespace JordanLeven\Plugins\ForceRefresh\Api;
9
10 use JordanLeven\Plugins\ForceRefresh\Api\Api_Handler;
11
12 /**
13 * Main class controller.
14 */
15 abstract class Api_Handler_Admin extends Api_Handler {
16
17 /**
18 * Returns the shared admin permission callback for admin endpoints.
19 *
20 * @return array
21 */
22 protected function get_admin_permission_callback(): array {
23 return array( $this, 'user_is_able_to_admin_force_refresh' );
24 }
25
26 /**
27 * Method for checking if a user can make changes to Force Refresh.
28 *
29 * @return bool True if use can modify Force Refresh settings.
30 */
31 public function user_is_able_to_admin_force_refresh(): bool {
32 return current_user_can( WP_FORCE_REFRESH_CAPABILITY );
33 }
34 }
35