This page provides an overview of the hooks and actions defined across various files of the WP AI Plugin. Each section lists the hooks or actions available, explains when they are triggered, and describes their intended use. Developers can use these hooks to extend or modify the plugin’s behavior.
Custom Tools Hooks (custom-tools.php)
This file handles custom tool functionality within the plugin.
wp_ai_custom_tools_init
- Type: Action
- Description: Fires during plugin initialization to set up custom tools.
- Usage: Use this hook to perform any setup required before custom tools are used.
wp_ai_register_custom_tool
- Type: Action / Filter
- Description: Provides a point to register or modify additional custom tools.
- Usage: Developers can hook into this to add their own tools or adjust existing ones.
Premade Tools Hooks (premade-tools.php)
This file manages the registration and configuration of premade (pre-configured) tools available with the plugin.
wp_ai_premade_tools_init
- Type: Action
- Description: Initializes the premade tools when the plugin loads.
- Usage: Automatically registers the set of premade tools offered by the plugin.
wp_ai_premade_tool_options
- Type: Filter
- Description: Allows modification of default options for premade tools.
- Usage: Developers can customize tool options before they are displayed.
TinyMCE Functions Hooks (tinymce-functions.php)
This file integrates custom functionality into the WordPress TinyMCE editor.
wp_ai_tinymce_plugins
- Type: Filter
- Description: Adds or modifies TinyMCE plugins related to AI functionality.
- Usage: Use this hook to load additional plugins into TinyMCE that are provided by the plugin.
wp_ai_tinymce_buttons
- Type: Filter
- Description: Inserts custom buttons into the TinyMCE toolbar.
- Usage: Extend the TinyMCE toolbar with AI-related actions by hooking into this filter.
Image Tools Hooks (image-tools.php)
This file provides functions for image processing and manipulation powered by AI.
wp_ai_image_tools_init
- Type: Action
- Description: Sets up image processing features on plugin load.
- Usage: Automatically initializes any AI-driven image tools required for enhancing or processing images.
wp_ai_image_tool_filter
- Type: Filter
- Description: Enables customization of image tool parameters.
- Usage: Developers can modify default image tool settings through this filter.
Media AI Page Hooks (media-ai-page.php)
This file creates and manages a dedicated media page in the WordPress admin for AI-related media tasks.
wp_ai_media_page_menu
- Type: Action
- Description: Registers a new admin menu item for the AI Media page.
- Usage: Hooked into the
admin_menu
action to add an entry for the AI Media page in the WordPress dashboard.
wp_ai_media_page_content
- Type: Action / Filter
- Description: Handles the output of the AI Media page.
- Usage: Customize the content and layout of the AI Media page by hooking into this action/filter.
WP AIB Functions Hooks (wpaib-functions.php)
This file contains core functions supporting AI Block functionality.
wp_ai_block_init
- Type: Action
- Description: Initializes features related to the AI Block.
- Usage: Typically hooked into the
init
action to set up AI Block capabilities.
wp_ai_block_settings
- Type: Filter
- Description: Filters the settings used by AI Blocks.
- Usage: Developers can adjust parameters such as block defaults or display settings.
WP AI Block Hooks (wp-ai-block.php)
This file registers and renders the custom WP AI Block within the WordPress block editor.
register_wp_ai_block
- Type: Action
- Description: Registers the custom AI Block with WordPress.
- Usage: Called during the
init
hook to ensure the block is available in the editor.
wp_ai_block_render
- Type: Callback / Filter
- Description: Handles front-end rendering of the AI Block content.
- Usage: Developers can override this rendering to customize the block output on posts or pages.
Additional Notes
- Priority & Parameters: Each hook may accept different parameters or require specific priorities. Consult the source code for details.
- Extensibility: These hooks and actions are designed to allow third-party developers to extend and customize plugin behavior without modifying core files.
- Security & Best Practices: When using these hooks, always sanitize input data and follow WordPress coding standards.