本文档描述了 WordPress 核心命令数据模块,包括用于管理命令和命令加载器的选择器和动作,适用于开发者扩展命令面板功能。
Namespace: core/commands.
Returns the registered command loaders.
Parameters
Object: State tree.boolean: Whether to return only contextual command loaders.Returns
import('./actions').WPCommandLoaderConfig[]: The list of registered command loaders.Returns the registered static commands.
Parameters
Object: State tree.boolean: Whether to return only contextual commands.Returns
import('./actions').WPCommandConfig[]: The list of registered commands.Returns whether the active context.
Parameters
Object: State tree.Returns
string: Context.Returns whether the command palette is open.
Parameters
Object: State tree.Returns
boolean: Returns whether the command palette is open.Closes the command palette.
Returns
Object: action.Opens the command palette.
Returns
Object: action.Returns an action object used to register a new command.
Parameters
WPCommandConfig: Command config.Returns
Object: action.Register command loader.
Parameters
WPCommandLoaderConfig: Command loader config.Returns
Object: action.Returns an action object used to unregister a command.
Parameters
string: Command name.Returns
Object: action.Unregister command loader hook.
Parameters
string: Command loader name.Returns
Object: action.