??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/mayshine.co.uk/wp-content/plugins/astra-sites/inc/assets/js/command-palette.js
⬅ Kembali
/**
* Starter Templates Command Palette Integration
*
* Registers Starter Templates customizer panels with WordPress Command Palette.
*`
* @package Astra Sites
* @since x.x.x
*/
( function ( wp ) {
'use strict';
if ( ! wp || ! wp.data || ! wp.commands ) {
return;
}
const { dispatch } = wp.data;
const { store: commandsStore } = wp.commands;
const { unregisterCommand, registerCommand } = dispatch( commandsStore );
const { imageDir, customCommands } = window.stCommandsPalette;
const { createElement } = wp.element;
const stIcon = createElement( 'img', {
src: `${ imageDir }logo.svg`,
alt: 'Starter Templates',
width: 20,
height: 20,
} );
// Function to remove existing commands
function removeExistingCommands() {
const store = wp.data.select( 'core/commands' );
if ( store ) {
const commandsToRemove = [
'themes.php-starter-templates',
'themes.php-ai-builder',
];
commandsToRemove.forEach( ( commandName ) => {
unregisterCommand( commandName );
} );
}
}
// Function to register commands.
function registerSTCommands() {
customCommands.forEach( function ( command ) {
try {
// Register the command.
dispatch( commandsStore ).registerCommand( {
name: command.name,
label: command.label,
searchLabel: command.searchLabel,
icon: stIcon,
callback: function () {
window.location.href = command.url;
},
} );
} catch ( error ) {
console.error( 'Error registering command:', error );
}
} );
}
// Remove existing commands first, then register new ones
if ( wp.domReady ) {
wp.domReady( function () {
removeExistingCommands();
registerSTCommands();
} );
} else {
if ( document.readyState === 'loading' ) {
document.addEventListener( 'DOMContentLoaded', function () {
removeExistingCommands();
registerSTCommands();
} );
} else {
removeExistingCommands();
registerSTCommands();
}
}
} )( window.wp );
Nama
Tipe
Ukuran
Diubah
Aksi
📜 command-palette.js
js
1.9 KB
2026-01-22 12:25
📜 elementor-admin-page.js
js
62.5 KB
2025-08-13 12:29
📜 eventsource.js
js
19.2 KB
2024-03-19 16:45
📜 eventsource.min.js
js
12 KB
2024-03-19 16:45
📜 fetch.umd.js
js
14.3 KB
2024-03-19 16:45
📜 helper.js
js
7.9 KB
2024-03-19 16:45
📜 history.js
js
26.6 KB
2024-03-19 16:45
📜 import-status.js
js
2.8 KB
2024-03-19 16:45
📜 index.js
js
0 B
2023-10-02 15:56