HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wp-rollback/src/commandPalette.js
import { store as commandsStore } from '@wordpress/commands';
import { dispatch } from '@wordpress/data';
import { useRollbackCommandLoader } from '../../shared-core/src/Frontend/commandPalette/RollbackCommandPalette';

/**
 * Register the rollback command loader directly with the WordPress commands
 * store. This runs at module load time — no React root or PluginArea needed.
 * The command palette reads from this store and calls the hook in its own
 * React rendering context, making React hooks valid inside the loader.
 */
dispatch( commandsStore ).registerCommandLoader( {
    name: 'wp-rollback/rollback-asset',
    hook: useRollbackCommandLoader,
} );