PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
← All changes | WPDataAccess/API/WPDA_API.php +17 -2 5.5.295.5.84 View file →
@@ -1,5 +1,5 @@
1 -<?php // phpcs:ignore Standard.Category.SniffName.ErrorCode
1 +<?php
2 2
3 3 /**
4 4 * JSON REST API.
5 5 */
@@ -24,9 +24,12 @@
24 24 $rest_route = isset( $GLOBALS['wp']->query_vars['rest_route'] )
25 25 ? untrailingslashit( $GLOBALS['wp']->query_vars['rest_route'] )
26 26 : '';
27 27
28 - if ( '/' . self::WPDA_NAMESPACE === $rest_route && ! current_user_can( 'manage_options' ) ) {
28 + if (
29 + '/' . self::WPDA_NAMESPACE === $rest_route &&
30 + ! WPDA::current_user_is_admin()
31 + ) {
29 32 return new \WP_Error(
30 33 'rest_cannot_access',
31 34 __( 'Only authenticated admin users can access the REST API.', 'wp-data-access' ),
32 35 array(
@@ -70,8 +73,20 @@
70 73
71 74 // Settings
72 75 $settings = new WPDA_Settings();
73 76 $settings->register_rest_routes();
77 +
78 + // Query Builder
79 + $qb = new WPDA_QB();
80 + $qb->register_rest_routes();
81 +
82 + // AI Assistant
83 + $ai = new WPDA_AI();
84 + $ai->register_rest_routes();
85 +
86 + // Scheduled Exports
87 + $export = new WPDA_Export();
88 + $export->register_rest_routes();
74 89
75 90 }
76 91
77 92 }