I have the following function that deducts at point when a post is removed. But when I remove a page, the wp_trash_post is also called.
// Remove 1 point if their post get removed
function deletePointFromUser($post_id) {
$post = get_post($post_id);
$authorid = $post->post_author;
$currentQPointNumber = get_user_meta($authorid, 'points', true);
// Delete 1 to the current Point Score
update_user_meta($authorid, 'points', $currentQPointNumber-1);
}
add_action('wp_trash_post', 'deletePointFromUser');
Is there a way to restrict this function to only apply to posts and not pages?