ID == 0 ) { $userprofile->print_error( new WP_Error( 'login_required', sprintf( __( 'No or Invalid user found !', 'user-profile' ) ) ) ); return; } $follow_user_id = $thisuser->ID; } if( is_user_logged_in() && $logged_in_user_id != $thisuser->ID ){ global $wpdb; $table = $wpdb->prefix . "user_profile_follow"; $follow_result = $wpdb->get_results("SELECT * FROM $table WHERE author_id = '$thisuser->ID' AND follower_id = '$logged_in_user_id'", ARRAY_A); $follow_text = $wpdb->num_rows > 0 ? __(' Following', 'user-profile') : __('Follow', 'user-profile'); $follow_class = $wpdb->num_rows > 0 ? 'following' : ''; ?>
%s", $follow_user_id, $follow_class, $follow_text ); } ?>