PHP Actions
wp3dconf/frontend/after_enqueue
Fires after all frontend scripts and styles have been enqueued.
add_action( 'wp3dconf/frontend/after_enqueue', function() {
wp_enqueue_script( 'my-frontend-addon', plugin_dir_url( __FILE__ ) . 'frontend-addon.js' );
} );
wp3dconf/frontend/before_skin_display
Fires before the configurator skin is rendered.
| Parameter | Type | Description |
|---|---|---|
$skin_instance | Object | The skin class instance |
$post_id | int | The configurator post ID |
wp3dconf/frontend/after_skin_display
Fires after the configurator skin has been rendered.
| Parameter | Type | Description |
|---|---|---|
$skin_instance | Object | The skin class instance |
$post_id | int | The configurator post ID |
wp3dconf/frontend/form/hidden_fields
Fires inside the configurator form after the default hidden fields. Use this to output additional hidden inputs.
| Parameter | Type | Description |
|---|---|---|
$skin | Object | The current skin instance |
The $skin object exposes a $skin->store property – an Alpine.js store reference string (e.g. $store.wp3dconf_123). Use this to bind hidden fields to live store values via x-bind:value.
add_action( 'wp3dconf/frontend/form/hidden_fields', function( $skin ) {
// Static value
echo '<input type="hidden" name="my_field" value="my_value">';
// Bind to Alpine.js store - value updates reactively as the customer configures
echo '<input type="hidden" name="active_layers"
x-bind:value=\'JSON.stringify(' . esc_attr( $skin->store ) . '.activeLayers)\'>';
// Bind attachment ID
echo '<input type="hidden" name="attachment_id"
x-bind:value=\'' . esc_attr( $skin->store ) . '.attachmentID\'>';
// Bind all custom layer data (text, range, etc.)
echo '<input type="hidden" name="custom_data"
x-bind:value=\'JSON.stringify(' . esc_attr( $skin->store ) . '.customData)\'>';
}, 10, 1 );
Controls Rendering Actions
These actions fire around the rendering of each control element in the frontend HTML output.
| Hook | Parameters | Description |
|---|---|---|
wp3dconf/frontend/controls/before_html | $skin | Before the entire controls wrapper |
wp3dconf/frontend/controls/after_html | $skin | After the entire controls wrapper |
wp3dconf/frontend/controls/before_inner_html | $skin | Before the inner controls container |
wp3dconf/frontend/controls/after_inner_html | $skin | After the inner controls container |
wp3dconf/frontend/controls/before_group_html | $skin | Before a group block is rendered |
wp3dconf/frontend/controls/after_group_html | $skin | After a group block is rendered |
wp3dconf/frontend/controls/before_control_item | $layer, $skin | Before a control item wrapper |
wp3dconf/frontend/controls/before_control_item_inner | $layer, $skin | Before a control item inner container |
wp3dconf/frontend/controls/after_control_item_inner | $layer, $skin | After a control item inner container |
wp3dconf/frontend/controls/before_control_icon | $uid, $skin | Before the control icon element |
wp3dconf/frontend/controls/after_control_icon | $uid, $skin | After the control icon element |
wp3dconf/frontend/controls/layer_{type}_html | $layer, $skin | Inside a control item for a specific layer type. Replace {type} with the layer type slug (e.g. layer_color_html). |
// Add content after a control icon
add_action( 'wp3dconf/frontend/controls/after_control_icon', function( $uid, $skin ) {
echo '<span class="my-badge">New</span>';
}, 10, 2 );
// Custom HTML for a specific layer type
add_action( 'wp3dconf/frontend/controls/layer_color_html', function( $layer, $skin ) {
echo '<span class="color-swatch" style="background:' . esc_attr( $layer['value'] ) . '"></span>';
}, 10, 2 );
Skins
wp3dconf/register_skins
Fires on plugins_loaded (priority 20). Use this hook to register a custom skin class via Skin_Registry::register().
| Parameter | Type | Description |
|---|---|---|
$skin_name | String | Unique skin identifier |
$skin | String|Object | Fully-qualified class name string or an object instance |
use WP3DCONF\Skin_Registry;
add_action( 'wp3dconf/register_skins', function() {
Skin_Registry::register( 'my-skin', My_Custom_Skin::class );
} );
You can also pass an object instance. The skin system will clone it and call set_post_id() automatically.
use WP3DCONF\Skin_Registry;
add_action( 'wp3dconf/register_skins', function() {
Skin_Registry::register( 'my-skin', new My_Custom_Skin() );
} );
Your skin class must extend WP3DCONF\Skin_Base and implement the display() method.
namespace My_Addon;
use WP3DCONF\Skin_Base;
use WP3DCONF\Skin_Registry;
class My_Custom_Skin extends Skin_Base {
protected $skin_id = 'my-skin';
public function display( $output = true ) {
// Render your skin HTML
}
}
wp3dconf/registered_skins
Filters the full array of registered skins after wp3dconf/register_skins has fired. Use this to modify or remove existing skin registrations.
| Parameter | Type | Description |
|---|---|---|
$skins | Array | All registered skins keyed by skin identifier |
add_filter( 'wp3dconf/registered_skins', function( $skins ) {
unset( $skins['accordion'] );
return $skins;
} );