Wordpress - Following count not changed

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Wordpress - Following count not changed



I'm using plugin"Users Following System", you can find below the function to get the following users count, the problem is when the user i follow delete his account the count not changed or updated!


<?php
/**
* Retrieve following count
*
* Gets the total number of users that the specified user is following
*
* @access private
* @since 1.0
* @param int $user_id - the ID of the user to retrieve a count for
* @return int
*/

function pwuf_get_following_count( $user_id = 0 )

if ( empty( $user_id ) )
$user_id = get_current_user_id();


$following = pwuf_get_following( $user_id );

$count = 0;

if ( $following )
$count = count( $following );


return (int) apply_filters( 'pwuf_get_following_count', $count, $user_id );

?>



here is the code i used into the author page


$following_count = pwuf_get_following_count( $curauth->ID );



So how can i update the count of the users i follow if they deleted their account?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard