ap_update_answers_count( integer $question_id, integer $counts = false, true|string $update_time = true )
Description #
Update count of answers in post meta.
Parameters #
- $question_idinteger (Required) Question ID.
- $countsinteger (Optional) Custom count value to update. Default value: false
- $update_timetrue | string (Optional) Update time. Default value: true
Source #
File: includes/qameta.php
function ap_update_answers_count( $question_id, $counts = false, $update_time = true ) { if ( false === $counts ) { $counts = ap_count_published_answers( $question_id ); } $args = array( 'answers' => $counts ); if ( $update_time ) { $args['last_updated'] = current_time( 'mysql' ); } return ap_insert_qameta( $question_id, $args ); }
Expand full source code Collapse full source code View on GitHub: includes/qameta.php:232
Add your comment