ap_delete_post_vote( integer $post_id, boolean|integer $user_id = false, boolean|string $up_vote = null )
Description #
Delete post vote and update qameta votes count.
Parameters #
- $post_idinteger (Required) Post ID.
- $user_idboolean | integer (Optional) User ID. Default value: false
- $up_voteboolean | string (Optional) Is up vote. Default value: null
Source #
File: includes/votes.php
function ap_delete_post_vote( $post_id, $user_id = false, $up_vote = null ) { $value = false; if ( null !== $up_vote ) { $value = $up_vote ? '1' : '-1'; } $type = $up_vote ? 'vote_up' : 'vote_down'; $rows = ap_delete_vote( $post_id, $user_id, 'vote', $value ); if ( false !== $rows ) { $counts = ap_update_votes_count( $post_id ); do_action( 'ap_undo_vote', $post_id, $counts ); do_action( 'ap_undo_' . $type, $post_id, $counts ); return $counts; } return false; }
Expand full source code Collapse full source code View on GitHub: includes/votes.php:562
Add your comment