Description
This filter is used to short-circuit the default output element HTML markup found in the Display Settings of Conductor Widgets. It can be used to bypass default Conductor Widget output element HTML markup. If this filter returns anything other than an empty string, that value will be used as HTML markup for output elements.
Note: Due to the nature of this filter, it is advised that only developers with extensive knowledge on the internal workings of Conductor use it.
Note: If you’re using this filter, some HTML markup is required to preserve jQuery Sortable functionality within output elements.
<li class="ui-state-default conductor-widget-output-element conductor-widget-output-element-{$id}" data-priority="{$priority}" data-id="{$id}" data-label="{$element['label']}" data-type="{$element['type']}"> <div class="dashicons dashicons-sort ui-sortable-handle"></div> Your HTML markup here... <span class="conductor-widget-output-element-controls"> Your controls HTML markup here... </span> </li>
This filter is executed when the Display Settings section of a Conductor Widget is rendered.
Technical Details
Type: Filter
Parameters:
$output (string): HTML markup for output element
$element (array): Configuration data for output element
$priority (int): Priority for output element
$id (string): Unique ID for output element, matches 'id' parameter in $element
$supports (array): Features which an output element supports (i.e. linking, visibility, label editing, removal, etc...), derived from 'output_features' in Conductor Widget defaults
$instance (array): Conductor Widget instance (settings)
$defaults (array): Conductor Widget defaults
$widget (Conductor_Widget): Conductor_Widget instance
Return Value: empty string
Resources
- View on GitHub
Class: Conductor_Widget
conductor_widget_defaults
conductor_widget_update
conductor_widget_instance
conductor_widget_admin_localize
conductor_widget_query_callback_prefix
Examples
The following example adds custom HTML markup for an output element with an ID matching my-custom-output-element
. It can be used in conjunction with the examples on the conductor_widget_defaults
documentation page.