| @@ -162,9 +162,9 @@ | ||
| 162 | 162 | * @return WP_Error |
| 163 | 163 | */ |
| 164 | 164 | protected function permission_error( $message, $endpoint = '') { |
| 165 | 165 | if( empty( $message ) ) { |
| 166 | - $message = __( 'Your session has expired. Please log in again.', 'templately' ); | |
| 166 | + $message = __( 'Sorry, you need to login/re-login again.', 'templately' ); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $_additional_data = [ |
| 170 | 170 | 'status' => rest_authorization_required_code(), |
| @@ -229,24 +229,8 @@ | ||
| 229 | 229 | * @return WP_REST_Response |
| 230 | 230 | */ |
| 231 | 231 | public function success( $data ) { |
| 232 | 232 | return new WP_REST_Response( $data, 200 ); |
| 233 | - } | |
| 234 | - | |
| 235 | - /** | |
| 236 | - * Enhanced success response wrapper that automatically adds success flag and wraps data | |
| 237 | - * | |
| 238 | - * @param $data mixed The data to be wrapped in the response | |
| 239 | - * | |
| 240 | - * @return WP_REST_Response | |
| 241 | - */ | |
| 242 | - public function successWithData( $data ) { | |
| 243 | - $enhanced_response = [ | |
| 244 | - 'success' => true, | |
| 245 | - 'data' => $data | |
| 246 | - ]; | |
| 247 | - | |
| 248 | - return $this->success( $enhanced_response ); | |
| 249 | 233 | } |
| 250 | 234 | /** |
| 251 | 235 | * @param $error_code string |
| 252 | 236 | * @param $error_message string|array |