Changeset 1943420
- Timestamp:
- 09/19/2018 04:19:56 AM (8 years ago)
- Location:
- ultimate-wp-rest/trunk
- Files:
-
- 4 edited
-
includes/plugin-module-rest-api.php (modified) (3 diffs)
-
includes/rest-api/rest-api-settings.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
ultimate_wp_rest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ultimate-wp-rest/trunk/includes/plugin-module-rest-api.php
r1938717 r1943420 31 31 $this->addApiCustomInSetting(); 32 32 33 define('UTM_WP_REST_API_AUTH_MODE', $this->PWP->setting->getOption('UTM_WP_REST_AUTH_MODE')[0]); 33 $this->PWP->setting->setOption('UTM_WP_REST_AUTH_MODE', ['jwt']); 34 35 define('UTM_WP_REST_API_AUTH_MODE', $this->PWP->setting->getOption('UTM_WP_REST_AUTH_MODE')[0]); 34 36 35 37 // Auth by Nonce … … 198 200 'section' => 'utm_wp_restauth_api', 199 201 'type' => 'array', 200 'value' => [' nonce'],202 'value' => ['jwt'], 201 203 'elements' => [ 202 204 ['htmltag' => 'template', … … 214 216 ], 215 217 'option' => [ 216 'nonce' => __('Auth by Account', UTM_WP_REST_TEXTDOMAIN),218 //'nonce' => __('Auth by Account', UTM_WP_REST_TEXTDOMAIN), 217 219 'jwt' => __('Auth by JWT', UTM_WP_REST_TEXTDOMAIN), 218 220 ], -
ultimate-wp-rest/trunk/includes/rest-api/rest-api-settings.php
r1938717 r1943420 12 12 13 13 public function registerRestRoute() { 14 // Get option by name 15 register_rest_route(UTM_WP_REST_API_NAMESPACE, UTM_WP_REST_API_SETTINGS . '/option', [ 16 [ 17 'methods' => WP_REST_Server::READABLE, 18 'callback' => [$this, 'getOptions'], 19 ], 20 ]); 21 14 22 // Get current version 15 23 register_rest_route(UTM_WP_REST_API_NAMESPACE, UTM_WP_REST_API_SETTINGS . '/version', [ … … 19 27 ], 20 28 ]); 29 } 30 31 public function getOptions($oRequest) { 32 $sOptionName = isset($_GET['name']) ? trim(wp_unslash($_GET['name'])) : false; 33 if ($sOptionName === false) { 34 $aJson = [ 35 'code' => 'rest_option_name_empty', 36 'message' => __('Option name is empty!', UTM_WP_REST_TEXTDOMAIN), 37 ]; 38 return new WP_Error($aJson, 404); 39 } 40 41 $aJson = [ 42 'name' => $sOptionName, 43 'value' => $this->PWP->setting->getOption($sOptionName), 44 ]; 45 46 return new WP_REST_Response($aJson, 200); 21 47 } 22 48 -
ultimate-wp-rest/trunk/readme.txt
r1938717 r1943420 51 51 52 52 == Changelog == 53 = 1.2.6 = 54 * Add API settings/option (GET) 55 * /settings/option?name=[option_name] 56 = 1.2.6 = 57 * Disable Auth by User Account 53 58 = 1.2.5 = 54 59 * Fixed bug UserInfo - User email existing -
ultimate-wp-rest/trunk/ultimate_wp_rest.php
r1938717 r1943420 3 3 * Plugin Name: Ultimate WP REST 4 4 * Description: This is a plug-in for the Menus, Thumb APIs, JWT authentication, caching, and many advanced features that help you develop web and mobile applications. 5 * Version: 1.2. 55 * Version: 1.2.7 6 6 * Text Domain: wpr 7 7 * Author: EGANY
Note: See TracChangeset
for help on using the changeset viewer.