PluginProbe
Elementor Website Builder – more than just a page builder / 3.7.4
Elementor Website Builder – more than just a page builder v3.7.4
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | data/base/controller.php +5 -4 4.1.0-dev33.7.4 View file →
@@ -24,14 +24,15 @@
24 24 /**
25 25 * Controller constructor.
26 26 *
27 27 * Register endpoints on 'rest_api_init'.
28 + *
28 29 */
29 30 public function __construct() {
30 31 // TODO: Controllers and endpoints can have common interface.
31 32
32 33 // TODO: Uncomment when native 3rd plugins uses V2.
33 - // $this->deprecated();
34 + //$this->deprecated();
34 35
35 36 $this->namespace = Manager::ROOT_NAMESPACE . '/v' . Manager::VERSION;
36 37 $this->rest_base = Manager::REST_BASE . $this->get_name();
37 38
@@ -188,9 +189,9 @@
188 189 protected function register_internal_endpoints() {
189 190 register_rest_route( $this->get_namespace(), '/' . $this->get_rest_base(), [
190 191 [
191 192 'methods' => WP_REST_Server::READABLE,
192 - 'callback' => [ $this, 'get_items' ],
193 + 'callback' => array( $this, 'get_items' ),
193 194 'args' => [],
194 195 'permission_callback' => function ( $request ) {
195 196 return $this->get_permission_callback( $request );
196 197 },
@@ -303,9 +304,9 @@
303 304 * Get permission callback.
304 305 *
305 306 * Default controller permission callback.
306 307 * By default endpoint will inherit the permission callback from the controller.
307 - * By default permission is `current_user_can( 'manage_options' );`.
308 + * By default permission is `current_user_can( 'administrator' );`.
308 309 *
309 310 * @param \WP_REST_Request $request
310 311 *
311 312 * @return bool
@@ -318,9 +319,9 @@
318 319 case 'UPDATE':
319 320 case 'PUT':
320 321 case 'DELETE':
321 322 case 'PATCH':
322 - return current_user_can( 'manage_options' );
323 + return current_user_can( 'administrator' );
323 324 }
324 325
325 326 return false;
326 327 }