Home » Docs » Classes » Class: Conductor_Widget_Default_Query

Description

This is the default class used for querying and also displaying content within Conductor Widgets. By default, if the conductor_widget_query filter value returns false (Boolean), this class is used in Conductor Widgets.

Construct/Instantiation

Upon instantiation, all default logic found in the Conductor_Widget_Query class is run.

A filter is added to found_posts to ensure the correct number of results are returned for more advanced queries. This logic is only executed on Conductor Widget queries. The number of found posts is adjusted if any of the following are true:

  • The offset query argument is set to a value greater than 1
  • Specific post IDs are included via the post__in query argument
  • Specific post IDs are excluded via the post__not_in query argument
  • The number of found posts is greater than the max_num_posts query argument

The number of found posts for Conductor Widgets is passed to the conductor_query_found_posts filter.

Conductor_Widget_Default_Query::query()

This function is performs a query using WP_Query and the Conductor Widget instance data. The query arguments are passed to the conductor_query_args filter before the query is executed.

Conductor_Widget_Default_Query::next_post()

This function advances the current query to the next post using WP_Query::next_post(). The conductor_query_next_post action is also triggered.

Conductor_Widget_Default_Query::the_post()

This function advances the current query to the next post and also sets up global post variables using WP_Query::the_post(). The conductor_query_the_post action is also triggered.

Conductor_Widget_Default_Query::get_pagination_links()

This function fetches pagination links for the current query and outputs them. It uses paginate_links() to generate the pagination links.

Conductor_Widget_Default_Query::get_excerpt_by_id()

This function fetches an excerpt for the current post. The content is passed to the the_content filter before it is returned.

Conductor_Widget_Default_Query::get_content_by_id()

This function fetches content for the current post. The content is passed to the the_content filter before it is returned.

 

This class is instantiated when the Conductor_Widget::widget() function is called (when a Conductor Widget is displayed on the front-end).

Output Element Callback Functions

Conductor_Widget_Default_Query::conductor_widget_featured_image()

This function outputs the featured image for the current post. The conductor_widget_featured_image_before action is triggered before the featured image output. The featured image size is passed to the conductor_widget_featured_image_size filter before it is rendered. The conductor_widget_featured_image_after action is triggered after the featured image output.

Conductor_Widget_Default_Query::conductor_widget_post_title()

This function outputs the post title for the current post. The conductor_widget_post_title_before action is triggered before the post title output. Output element data is used to determine if the post title should be linked to the post. The conductor_widget_post_title_after action is triggered after the post title output.

Conductor_Widget_Default_Query::conductor_widget_author_byline()

This function outputs the author byline for the current post. The conductor_widget_author_byline_before action is triggered before the author byline output. The author byline consists of the author’s display name wrapped in a link to the author’s posts and the date. The conductor_widget_author_byline_after action is triggered after the author byline output.

Conductor_Widget_Default_Query::conductor_widget_post_content()

This function outputs the post content (or excerpt) for the current post. The conductor_widget_post_content_before action is triggered before the post content output. The content_display_type widget setting is used to determine which type of content (excerpt or content) should be output. The conductor_widget_post_content_after action is triggered after the post content output.

Conductor_Widget_Default_Query::conductor_widget_read_more()

This function outputs the read more link for the current post. The conductor_widget_read_more_before action is triggered before the read more output. Output element data is used to determine if the read more element should be linked to the post. The conductor_widget_read_more_after is triggered after the read more output.

Technical Details

Resources