The thing is that the profile seems to be rendered as buddypress member profile.
There were two issue.
1) Display dynamic current member profile name
To display the dynamic current profile user name. I've created the following shortcode and added it to "Custom Code" section offered by Toolset:
=> hidden link
add_shortcode( 'get_member_profile_name', 'func_get_member_profile_name' );
function func_get_member_profile_name() {
global $bp;
return $bp->displayed_user->userdata->user_login;
}
It returns the username.
And within your elemenor's template, I've added the shortcode as given under.
[get_member_profile_name]'s
2) Filter the view with the current member profile author
In addition to that, we can not use view's shortcode attribute to pass the current profile member ID as shortcode within the elemenor as it does not parse the nested shortcode correctly:
[wpv-view name="user-top-10-books" userusername='[get_member_profile_id]']
As above solution was not possible, as a workaround:
To filter the view with the current profile author ID, I've added the following view's filter to "Custom Code" section offered by Toolset:
add_filter( 'wpv_filter_query', 'func_filter_view_by_author',10,3);
function func_filter_view_by_author( $query_args, $view_settings, $view_id ) {
global $bp;
if($view_id == 2223){
$query_args['author__in'] = array($bp->displayed_user->id);
}
return $query_args;
}
Now, the thing is that with the view, you build your loop output using block:
=> hidden link
As you are using the view within the elementor, we do not recommend to use views or view's loop output build in block as it will cause the compatibility issue. So you have to build the view's loop without using the block.
=> hidden link
I can see now, that on tester member profile page, it shows the correct post:
=> hidden link
As well as on minesh member profile: hidden link