['POST'], 'args' => [ 'nonce' => [ 'validate_callback' => function ($value) { return wp_verify_nonce($value, 'wp_rest'); }, 'required' => true ], ], 'callback' => [$this, 'revert'], 'permission_callback' => function () { return PermissionCheck::hasPermission(true); } ] ]); } /** * Delete backup */ public function revert() { update_option('button_contact_legacy', "yes"); return [ 'status' => 'success' ]; } }