$52 GRAYBYTE WORDPRESS FILE MANAGER $67

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/Subscriptions/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/Subscriptions//SubscriptionsAdminPage.php
<?php

namespace Give\Subscriptions;

use Give\Subscriptions\Actions\LoadSubscriptionDetailsAssets;
use Give\Subscriptions\Actions\LoadSubscriptionsListTableAssets;
use Give\Subscriptions\Models\Subscription;

class SubscriptionsAdminPage
{
    /**
     * @since 2.24.0
     */
    public function loadScripts()
    {
        give(LoadSubscriptionsListTableAssets::class)();
    }

    /**
     * Render the Subscription Details page.
     *
     * @since 4.8.0
     */
    public function render()
    {
        if (self::isShowingDetailsPage()) {
            remove_action('give_forms_page_give-subscriptions', 'give_subscriptions_page');

            $subscription = Subscription::find(absint($_GET['id']));

            if ( ! $subscription) {
                wp_die(__('Subscription not found', 'give'), 404);
            }

            give(LoadSubscriptionDetailsAssets::class)();
        } else {
            give(LoadSubscriptionsListTableAssets::class)();
        }

        echo '<div id="give-admin-subscriptions-root"></div>';
    }

    /**
     * Display a button on the old subscriptions table that switches to the React view
     *
     * @since 2.24.0
     */
    public function renderReactSwitch()
    {
        ?>
        <script type="text/javascript">
            function showReactTable () {
                fetch( '<?php echo esc_url_raw(rest_url('give-api/v2/admin/subscriptions/view?isLegacy=0')) ?>', {
                    method: 'GET',
                    headers: {
                        ['X-WP-Nonce']: '<?php echo wp_create_nonce('wp_rest') ?>'
                    }
                })
                    .then((res) => {
                        window.location.reload();
                    });
            }
            jQuery( function() {
                jQuery(jQuery(".wrap .wp-header-end")).before(
                    '<button class="page-title-action" onclick="showReactTable()"><?php _e('Switch to New View', 'give') ?></button>'
                );
            });
        </script>
        <?php
    }

    /**
     * Helper function to determine if current page is Give Subscriptions admin page
     *
     * @since 2.24.0
     *
     * @return bool
     */
    public static function isShowing()
    {
        return isset($_GET['page']) && $_GET['page'] === 'give-subscriptions' && ! isset($_GET['view']);
    }

    /**
     * @since 4.8.0
     */
    public static function isShowingDetailsPage(): bool
    {
        return isset($_GET['id'], $_GET['page']) && 'give-subscriptions' === $_GET['page'];
    }
}

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
Actions
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
DataTransferObjects
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Endpoints
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Factories
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
LegacyListeners
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
ListTable
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Migrations
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Models
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Repositories
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
ValueObjects
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
ViewModels
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
resources
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
ServiceProvider.php
4.311 KB
28 Jan 2026 8.00 PM
bravetechrwanda / bravetechrwanda
0644
SubscriptionQuery.php
3.992 KB
10 Sep 2025 5.42 PM
bravetechrwanda / bravetechrwanda
0644
SubscriptionsAdminPage.php
2.501 KB
10 Sep 2025 5.42 PM
bravetechrwanda / bravetechrwanda
0644

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