get_body(), true ); $status = Admin_Menu_Chatbot::instance()->save( $body ); return $this->handle_response( $status ); } catch ( \Throwable $error ) { return $this->handle_response( array( 'code' => $error->getCode(), 'message' => $error->getMessage(), ) ); } } public static function get_rest_args() { return array(); } public static function get_rest_method() { return \WP_REST_Server::CREATABLE; } public function get_rest_permission() { if ( ! current_user_can( 'manage_options' ) ) { return false; } return true; } }