Access Functions are functions that abstract several layers of complexity and provide simpler ways to accomplish common tasks. They are often used to provide a more readable and maintainable codebase.
The concept is modeled around core WordPress functions like register_post_type, register_taxonomy, etc, where the function signature is simple and the function itself abstracts the complexity of the underlying APIs.
Registers a new toolbar button for the document editor.
This function allows registering a new editor toolbar button with the following parameters:
name
(string): The name of the button to register.config
(Object): The configuration object for the button.priority
(number, optional): The priority for the button, with lower numbers meaning higher priority. Default is 10.
Example usage:
const { registerDocumentEditorToolbarButton } = window.WPGraphQLIDE;
registerDocumentEditorToolbarButton( 'toggle-auth', toggleAuthButton, 1 );