Appearance
Developer Reference
Voxel Toolkit exposes hooks for extending or reacting to its behaviour. All hooks are namespaced under voxel_toolkit/.
Filters
Registries
Use these to add your own features to the Voxel Toolkit screens.
| Filter | Modifies |
|---|---|
voxel_toolkit/available_functions | The function registry shown under Functions |
voxel_toolkit/available_widgets | The widget registry shown under Widgets |
voxel_toolkit/available_post_fields | The post field registry shown under Post Fields |
php
add_filter( 'voxel_toolkit/available_functions', function ( $functions ) {
$functions['my_function'] = array(
'name' => __( 'My Function', 'my-plugin' ),
'description' => __( 'What it does.', 'my-plugin' ),
'class' => 'My_Function_Class',
'file' => 'functions/class-my-function.php',
);
return $functions;
} );Behaviour
| Filter | Purpose |
|---|---|
voxel_toolkit/sanitize_function_settings/{function_key} | Sanitise a function's settings before they're saved |
voxel_toolkit/should_redirect_post | Override whether the Redirect Posts function redirects a given post |
voxel_toolkit/auto_share/preview_image | Change the preview image used in an auto-shared timeline post |
voxel_toolkit/auto_share/fallback_image | Change the fallback image when a post has none |
voxel_toolkit/ai_autofill/settings | Filter AI Autofill's settings |
voxel_toolkit/ai_autofill/store | Filter the data AI Autofill writes to the draft |
voxel_toolkit/ai_autofill/embedded | Control AI Autofill's embedded mode |
Actions
| Action | Fires when |
|---|---|
voxel_toolkit/settings_updated | Plugin settings are saved |
voxel_toolkit/function_initialized/{function_key} | A function is initialised |
voxel_toolkit/function_deinitialized/{function_key} | A function is torn down |
voxel_toolkit/post_auto_verified | Auto Verify Posts marks a post verified |
voxel_toolkit/post_status_changed | A post's status changes through a toolkit feature |
voxel_toolkit/term_added | Add Category creates a term from the front end |
voxel_toolkit/term_pending_approval | A front-end term is created awaiting approval |
voxel_toolkit/term_approved | A pending term is approved |
voxel_toolkit/checklist/item_checked | A Checklist (VT) item is ticked |
voxel_toolkit/settings_page_footer | Rendering the footer of a settings screen |
Checking state in code
Voxel_Toolkit_Settings is the source of truth for whether a feature is on:
php
if ( Voxel_Toolkit_Settings::instance()->is_function_enabled( 'auto_verify_posts' ) ) {
// The function is active.
}Voxel_Toolkit_Functions exposes the registries:
php
$functions = Voxel_Toolkit_Functions::instance();
$functions->get_available_functions(); // everything registered
$functions->get_active_functions(); // only what's enabled
$functions->is_function_active( 'ai_bot' );Constants
| Constant | Value |
|---|---|
VOXEL_TOOLKIT_VERSION | Current plugin version |
VOXEL_TOOLKIT_PLUGIN_DIR | Absolute path to the plugin directory |
VOXEL_TOOLKIT_PLUGIN_URL | URL to the plugin directory |
VOXEL_TOOLKIT_PLUGIN_FILE | Absolute path to the main plugin file |
Adding a custom post field
Post field files declare two classes — a manager that handles hooks and AJAX, and the field type itself extending \Voxel\Post_Types\Fields\Base_Post_Field. Register the field type with Voxel early, through the voxel/field-types filter, and gate it on the toolkit setting:
php
add_filter( 'voxel/field-types', function ( $fields ) {
if ( ! Voxel_Toolkit_Settings::instance()->is_function_enabled( 'post_field_my_field' ) ) {
return $fields;
}
if ( ! class_exists( '\Voxel\Post_Types\Fields\Base_Post_Field' ) ) {
return $fields;
}
$fields['my-field'] = '\My_Field_Type';
return $fields;
} );Always load the field file unconditionally and only initialise the manager when the field is enabled — that keeps the class available to Voxel while respecting the toggle.

