AnsPress_Views::insert_views( string $template )
Description #
Insert view count on loading single question page.
Parameters #
- $templatestring (Required) Template name.
Source #
File: includes/views.php
public static function insert_views( $template ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found if ( is_question() ) { // By default do not store views in ap_views table. if ( apply_filters( 'ap_insert_view_to_db', false ) ) { ap_insert_views( get_question_id(), 'question' ); } // Update qameta. ap_update_views_count( get_question_id() ); } }
Expand full source code Collapse full source code View on GitHub: includes/views.php:39
Add your comment