| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the WindPress package. |
| 5 |
* |
| 6 |
* (c) Joshua Gugun Siagian <suabahasa@gmail.com> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
declare (strict_types=1); |
| 12 |
namespace WindPress\WindPress\Api; |
| 13 |
|
| 14 |
use WIND_PRESS; |
| 15 |
use WP_REST_Request; |
| 16 |
class AbstractApi |
| 17 |
{ |
| 18 |
public const API_NAMESPACE = WIND_PRESS::REST_NAMESPACE; |
| 19 |
protected function permission_callback(WP_REST_Request $wprestRequest): bool |
| 20 |
{ |
| 21 |
return wp_verify_nonce($wprestRequest->get_header('X-WP-Nonce'), 'wp_rest') && current_user_can('manage_options'); |
| 22 |
} |
| 23 |
} |
| 24 |
|