Home » Docs » Hooks » Filters » Class: Conductor_Widget » conductor_widget_update

Description

This filter is used to change the updated settings for Conductor Widgets before they are stored in the database.

Note: The Conductor Widget will sanitize all default Conductor Widget settings prior to the execution of this filter.

This filter is executed when the Conductor_Widget::update() function is called (when a Conductor Widget instance is updated/saved).

Technical Details

  • Type: Filter
  • Parameters:
    • $new_instance (array): Updated Conductor Widget instance containing data to be saved to the database
    • $old_instance (array): Old Conductor Widget instance
    • $widget (Conductor_Widget): Conductor Widget
  • Default: array

Resources

Examples

The following example demonstrates how to add a custom setting to Conductor Widget instances based on a CSS class.

Note: This example is nearly identical to the conductor_widget_instance example. The difference between the two is that conductor_widget_instance is only executed on the front-end at run-time and conductor_widget_update is executed in the admin upon updating/saving of a Conductor Widget (stores data in the database).

The following example demonstrates how to create a custom callback function for a single output element (a custom field).