AnsPress_Theme::template_include_theme_compat( string $template = '' )
Description #
Reset main query vars and filter ‘the_content’ to output a AnsPress template part as needed.
Parameters #
- $templatestring (Optional) Template name. Default value: ''
Source #
File: includes/class-theme.php
public static function template_include_theme_compat( $template = '' ) { if ( ap_current_page( 'question' ) ) { ob_start(); echo '<div class="anspress" id="anspress">'; AnsPress_Common_Pages::question_page(); echo '</div>'; $html = ob_get_clean(); ap_theme_compat_reset_post( array( 'ID' => get_question_id(), 'post_title' => get_the_title( get_question_id() ), 'post_author' => get_post_field( 'post_author', get_question_id() ), 'post_date' => get_post_field( 'post_date', get_question_id() ), 'post_content' => $html, 'post_type' => 'question', 'post_status' => get_post_status( get_question_id() ), 'is_single' => true, 'comment_status' => 'closed', ) ); } if ( true === anspress()->theme_compat->active ) { ap_remove_all_filters( 'the_content' ); } return $template; }
Expand full source code Collapse full source code View on GitHub: includes/class-theme.php:55
Add your comment