PHP 8.2.31
Preview: ThemeRollbackButton.php Size: 1.08 KB
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/wp-rollback/src/Rollbacks/ThemeRollback/Views/ThemeRollbackButton.php

<?php

/**
 * @package WpRollback\Free\Rollbacks\ThemeRollback\Views
 */

declare(strict_types=1);

namespace WpRollback\Free\Rollbacks\ThemeRollback\Views;

use WpRollback\SharedCore\Core\Assets\AssetsManager;
use WpRollback\SharedCore\Core\SharedCore;
use WpRollback\SharedCore\Rollbacks\Traits\PluginHelpers;

/**
 * Handles theme rollback button functionality and assets.
 *
 */
class ThemeRollbackButton
{
    use PluginHelpers;
    /**
     * Register and enqueue theme rollback assets.
     *
     */
    public function __invoke(): void
    {
        global $pagenow;

        if ('themes.php' !== $pagenow) {
            return;
        }

        // Don't enqueue on network admin - themes use table view with action links there
        if (is_network_admin()) {
            return;
        }

        // Don't enqueue on individual sites if plugin is network activated
        if ($this->isNetworkActivated()) {
            return;
        }

        $assetsManager = SharedCore::container()->make(AssetsManager::class);
        $assetsManager->enqueueScript('themesAdmin', [], false);
    }
} 

Directory Contents

Dirs: 2 × Files: 1

Name Size Perms Modified Actions
- drwxr-xr-x 2026-05-06 14:06:55
Edit Download
resources DIR
- drwxr-xr-x 2026-05-06 14:06:55
Edit Download
1.08 KB lrw-r--r-- 2026-05-06 14:06:55
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).