wp3dconf/editor/after_enqueue
Fires after all editor scripts and styles have been enqueued. Use this to enqueue additional assets that depend on the editor.
add_action( 'wp3dconf/editor/after_enqueue', function() {
wp_enqueue_script( 'my-editor-addon', plugin_dir_url( __FILE__ ) . 'editor-addon.js' );
} );
PHP Admin Actions
wp3dconf/admin/settings/section
Fires inside the plugin settings page, allowing addons to register additional settings sections.
add_action( 'wp3dconf/admin/settings/section', function() {
?>
<div class="wp3dconf-settings-section">
<h2><?php esc_html_e( 'My Addon Settings', 'my-addon' ); ?></h2>
<table class="form-table">
<tr>
<th><?php esc_html_e( 'My Option', 'my-addon' ); ?></th>
<td>
<input type="text" name="my_addon_option"
value="<?php echo esc_attr( get_option( 'my_addon_option' ) ); ?>">
</td>
</tr>
</table>
</div>
<?php
} );
wp3dconf/admin/settings/save
Fires when the plugin settings form is submitted. Use this to save additional addon settings.
add_action( 'wp3dconf/admin/settings/save', function() {
if ( isset( $_POST['my_addon_option'] ) ) {
update_option( 'my_addon_option', sanitize_text_field( wp_unslash( $_POST['my_addon_option'] ) ) );
}
} );
wp3dconf/admin/configurator/metabox
Fires inside the configurator edit screen, below the main editor. Use this to add a custom metabox or additional UI.
| Parameter | Type | Description |
|---|---|---|
$post_id | int | The configurator post ID |
add_action( 'wp3dconf/admin/configurator/metabox', function( $post_id ) {
?>
<div class="postbox">
<h2><?php esc_html_e( 'My Addon', 'my-addon' ); ?></h2>
<div class="inside">
<!-- Custom metabox content -->
</div>
</div>
<?php
}, 10, 1 );
PHP Admin Filters
wp3dconf/admin/configurator/tabs
Filters the tab list in the configurator editor sidebar. Use this to add custom tabs.
| Parameter | Type | Description |
|---|---|---|
$tabs | Array | Registered tabs keyed by tab ID |
add_filter( 'wp3dconf/admin/configurator/tabs', function( $tabs ) {
$tabs['my-tab'] = array(
'label' => __( 'My Tab', 'my-addon' ),
'icon' => 'dashicons-admin-generic',
);
return $tabs;
} );
wp3dconf/admin/layer/types
Filters the available layer types. Use this to register a custom layer type.
| Parameter | Type | Description |
|---|---|---|
$types | Array | Registered layer types keyed by type slug |
add_filter( 'wp3dconf/admin/layer/types', function( $types ) {
$types['my-type'] = array(
'label' => __( 'My Layer Type', 'my-addon' ),
);
return $types;
} );