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

Description

This filter is used to create an instance of the Conductor_Widget_Query. If this filter returns anything other than false (Boolean), that value will be used as the Conductor Widget Query. It is expected that the value returned is an instance of Conductor_Widget_Query. If false (Boolean) is returned, a Conductor_Widget_Default_Query instance is created.

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.

This filter is executed when the Conductor_Widget::widget() function is called (when a Conductor Widget is displayed, before the default query is initialized).

Technical Details

  • Type: Filter
  • Parameters:
    • $conductor_widget_query (Conductor_Widget_Query): Conductor_Widget_Query instance
    • $conductor_widget_query_args (array): Conductor Widget query arguments
    • $instance (array): Conductor Widget instance (settings)
    • $args (array): Conductor widget arguments (before_widget, after_widget, before_title, after_title)
    • $widget (Conductor_Widget): Conductor_Widget instance
  • Default: false

Resources

Examples

The following example creates a custom Conductor_Widget_Query instance to over-ride the default Conductor_Widget_Default_Query instance based on a CSS class.