1 | <?php |
||
12 | class Jetpack_BbPress_REST_API { |
||
13 | |||
14 | /** |
||
15 | * Singleton |
||
16 | * |
||
17 | * @var Jetpack_BbPress_REST_API. |
||
18 | */ |
||
19 | private static $instance; |
||
20 | |||
21 | /** |
||
22 | * Returns or creates the singleton. |
||
23 | * |
||
24 | * @return Jetpack_BbPress_REST_API |
||
25 | */ |
||
26 | public static function instance() { |
||
33 | |||
34 | /** |
||
35 | * Jetpack_BbPress_REST_API constructor. |
||
36 | */ |
||
37 | private function __construct() { |
||
42 | |||
43 | /** |
||
44 | * Adds the bbPress post types to the rest_api_allowed_post_types filter. |
||
45 | * |
||
46 | * @param Array $allowed_post_types Allowed post types. |
||
47 | * |
||
48 | * @return array |
||
49 | */ |
||
50 | public function allow_bbpress_post_types( $allowed_post_types ) { |
||
56 | |||
57 | /** |
||
58 | * Adds the bbpress meta keys to the rest_api_allowed_public_metadata filter. |
||
59 | * |
||
60 | * @param Array $allowed_meta_keys Allowed meta keys. |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | public function allow_bbpress_public_metadata( $allowed_meta_keys ) { |
||
86 | |||
87 | /** |
||
88 | * Adds the needed caps to the bbp_map_meta_caps filter. |
||
89 | * |
||
90 | * @param array $caps Capabilities for meta capability. |
||
91 | * @param string $cap Capability name. |
||
92 | * @param int $user_id User id. |
||
93 | * @param array $args Arguments. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | public function adjust_meta_caps( $caps, $cap, $user_id, $args ) { |
||
137 | |||
138 | /** |
||
139 | * Should adjust_meta_caps return early? |
||
140 | * |
||
141 | * @param array $caps Capabilities for meta capability. |
||
142 | * @param string $cap Capability name. |
||
143 | * @param int $user_id User id. |
||
144 | * @param array $args Arguments. |
||
145 | * |
||
146 | * @return bool |
||
147 | */ |
||
148 | private function should_adjust_meta_caps_return_early( $caps, $cap, $user_id, $args ) { |
||
161 | } |
||
162 |