I created a widget with additional settings fields (orderby etc.) that displays users using
new WP_User_Query( $args ).
I also created a
follow user button. I was able to successfully use ajax to update the database, show custom message and more.
Now I've reached the point where I want to update the list of followers inside the widget (with AJAX) once
follow user button has been clicked. but I'm not sure how to tackle this one.
Output of the widget is placed inside a
container class, so it will be easy to target this class inside the ajax
<div class="follow-me-container"> <table>...</table> </div>
Based on online tutorials, I've to completely rebuilt the query inside the
wp_ajax_ function. However, the widget uses predefined settings which I want to keep.
Any help in the right direction is much appreciated.