apps/wp-importer
이 콘텐츠는 아직 해당 언어로 제공되지 않습니다.
Events
Section titled “Events”default
Section titled “default”default: DevToolbarApp;
Defined in: studiocms/packages/studiocms_devapps/src/apps/wp-importer.ts:45
Function
Defines a toolbar application for importing content from a WordPress site into StudioCMS.
The canvas element where the application will be rendered.
The target element for event listeners.
Returns
Section titled “Returns”- The toolbar application definition.
init Initializes the toolbar application by creating the canvas and setting up event listeners.
createCanvas Creates and appends the main window component to the canvas. Sets up the form and its event listeners.
closeOnOutsideClick Closes the window component when a click is detected outside of the specified event target.
‘astro:after-swap’ Recreates the canvas when the ‘astro:after-swap’ event is triggered.
‘submit’ Handles the form submission, including validation, showing a loading spinner, and making a POST request to the WordPress API endpoint.
Constant
Section titled “Constant”wpAPIEndpoint - The endpoint URL for the WordPress API.