AP_QA_Query_Hooks::loop_start( WP_Query $query )

Description #

Make sure single question loop render AnsPress shortcode.

Parameters #

  • $query
    WP_Query (Required) Query loop.

Changelog #

VersionDescription
4.1.3Introduced.

Source #

File: includes/qaquery-hooks.php

	public static function loop_start( $query ) {
		if ( $query->is_main_query() && $query->is_single() && 'question' === get_query_var( 'post_type' ) ) {
			$query->posts[0]->post_content = '[anspress]';
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment