$98 GRAYBYTE WORDPRESS FILE MANAGER $80

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/itiministry.org/plugins/give/src/Donations/Endpoints/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/Donations/Endpoints//SwitchDonationView.php
<?php

namespace Give\Donations\Endpoints;

use WP_REST_Request;
use WP_REST_Response;

class SwitchDonationView extends Endpoint
{
    /**
     * @var string
     */
    protected $endpoint = 'admin/donations/view';

    /**
     * @var string
     */
    protected $slug = 'donations';

    /**
     * @inheritDoc
     */
    public function registerRoute()
    {
        register_rest_route(
            'give-api/v2',
            $this->endpoint,
            [
                [
                    'methods' => 'GET',
                    'callback' => [$this, 'handleRequest'],
                    'permission_callback' => [$this, 'permissionsCheck'],
                ],
                'args' => [
                    'isLegacy' => [
                        'type' => 'boolean',
                        'required' => true,
                    ]
                ],
            ]
        );
    }

    /**
     * @param WP_REST_Request $request
     * @since 2.20.0
     *
     * @return WP_REST_Response
     */
    public function handleRequest(WP_REST_Request $request)
    {
        $success = true;
        $isLegacyEnabled = $request->get_param('isLegacy');
        $userId = get_current_user_id();
        if($userId)
        {
            update_user_meta($userId, sprintf('_give_%s_archive_show_legacy', $this->slug), $isLegacyEnabled);
        }
        else
        {
            $success = false;
        }

        return new WP_REST_Response(
            $success
        );
    }
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
DonationActions.php
6.711 KB
28 Jan 2026 8.00 PM
bravetechrwanda / bravetechrwanda
0644
Endpoint.php
1.244 KB
28 Jan 2026 8.00 PM
bravetechrwanda / bravetechrwanda
0644
ListDonations.php
11.633 KB
30 Oct 2025 12.17 AM
bravetechrwanda / bravetechrwanda
0644
ListDonationsStats.php
3.355 KB
1 Oct 2025 3.37 PM
bravetechrwanda / bravetechrwanda
0644
SwitchDonationView.php
1.466 KB
12 May 2022 3.49 AM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF