$38 GRAYBYTE WORDPRESS FILE MANAGER $68

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

/home/bravetechrwanda/itiministry.org/plugins/give/src/Donors/Actions/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/Donors/Actions//LoadDonorAdminOptions.php
<?php

namespace Give\Donors\Actions;

use Give\API\REST\V3\Routes\Donors\ValueObjects\DonorRoute;
use Give\Helpers\IntlTelInput;

/**
 * The purpose of this action is to have a centralized place for localizing options used on many different places
 * by donor scripts (list tables, blocks, etc.)
 *
 * @since 4.6.1 Rename to LoadDonorAdminOptions
 * @since 4.4.0
 */
class LoadDonorAdminOptions
{
    public function __invoke()
    {
        wp_register_script('give-donor-options', false);
        wp_localize_script('give-donor-options', 'GiveDonorOptions', $this->getDonorOptions());
        wp_enqueue_script('give-donor-options');
    }

    /**
     * Get all donor options for localization
     *
     * @return array
     * @since 4.4.0
     */
    private function getDonorOptions(): array
    {
        $isAdmin = is_admin();

        return [
            'isAdmin' => $isAdmin,
            'adminUrl' => admin_url(),
            'apiRoot' => rest_url(DonorRoute::NAMESPACE . '/' . DonorRoute::BASE),
            'apiNonce' => wp_create_nonce('wp_rest'),
            'donorsAdminUrl' => admin_url('edit.php?post_type=give_forms&page=give-donors'),
            'currency' => give_get_currency(),
            'intlTelInputSettings' => IntlTelInput::getSettings(),
            'nameTitlePrefixes' => give_get_option('title_prefixes', array_values(give_get_default_title_prefixes())),
            'countries' => $this->decodeHtmlEntities(give_get_country_list()),
            'states' => $this->getStatesData(),
            'isRecurringEnabled' => defined('GIVE_RECURRING_VERSION') ? GIVE_RECURRING_VERSION : null,
            'mode' => give_is_test_mode() ? 'test' : 'live'
        ];
    }

    /**
     * Get states data with decoded HTML entities
     *
     * @since 4.4.0
     */
    private function getStatesData(): array
    {
        return [
            'list' => $this->decodeHtmlEntities(give_states_list(), true),
            'labels' => give_get_states_label(),
            'noStatesCountries' => array_keys(give_no_states_country_list()),
            'statesNotRequiredCountries' => array_keys(give_states_not_required_country_list()),
        ];
    }

    /**
     * Decode HTML entities from an array of strings or nested arrays
     *
     * @since 4.4.0
     */
    private function decodeHtmlEntities(array $data, bool $isNested = false): array
    {
        if ($isNested) {
            return array_map(function ($nestedData) {
                return $this->decodeHtmlEntities($nestedData);
            }, $data);
        }

        return array_map(function ($item) {
            return html_entity_decode($item, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');
        }, $data);
    }
}

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
CreateUserFromDonor.php
1.155 KB
7 Dec 2023 1.03 AM
bravetechrwanda / bravetechrwanda
0644
LoadDonorAdminOptions.php
2.661 KB
30 Jul 2025 2.55 AM
bravetechrwanda / bravetechrwanda
0644
LoadDonorDetailsAssets.php
1.087 KB
18 Jun 2025 7.01 PM
bravetechrwanda / bravetechrwanda
0644
LoadDonorsListTableAssets.php
3.119 KB
16 Oct 2025 6.10 PM
bravetechrwanda / bravetechrwanda
0644
SendDonorUserRegistrationNotification.php
0.806 KB
7 Dec 2023 1.03 AM
bravetechrwanda / bravetechrwanda
0644
UpdateAdminDonorDetails.php
0.557 KB
24 Apr 2024 7.56 PM
bravetechrwanda / bravetechrwanda
0644

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