Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.94 KB

ACCESS_FUNCTIONS.md

File metadata and controls

29 lines (18 loc) · 1.94 KB

Access Functions

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.

Table of Contents

registerDocumentEditorToolbarButton

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 );

Screenshot of the GraphiQL IDE highlighting the Toolbar buttons within the Document Editor region.