PluginProbe
ActivityPub / trunk
ActivityPub vtrunk
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / includes / rest / class-reader-terms-controller.php

class-reader-terms-controller.php in ActivityPub trunk, at includes/rest/class-reader-terms-controller.php

40 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Reader_Terms_Controller file.
4 *
5 * @package Activitypub
6 */
7
8 namespace Activitypub\Rest;
9
10 /**
11 * Reader_Terms_Controller class.
12 *
13 * Restricts the WordPress REST routes that core generates for the `ap_tag` and
14 * `ap_object_type` taxonomies. Their terms are derived from the cached remote
15 * posts, so they are limited to users who can use ActivityPub.
16 *
17 * @since 9.3.0
18 */
19 class Reader_Terms_Controller extends \WP_REST_Terms_Controller {
20 use Reader_Permission;
21
22 /**
23 * Check whether a request has read access to a single term.
24 *
25 * @since 9.3.0
26 *
27 * @param \WP_REST_Request $request Full details about the request.
28 * @return true|\WP_Error True if the request has read access, WP_Error otherwise.
29 */
30 public function get_item_permissions_check( $request ) {
31 $permission = $this->check_reader_capability();
32
33 if ( \is_wp_error( $permission ) ) {
34 return $permission;
35 }
36
37 return parent::get_item_permissions_check( $request );
38 }
39 }
40