hi, Here is my “coding” way for get user liked post by user on author page.
wpulike use a custom table that store the data. so i get an array of post_id liked by a specific user_id
like that in my author.php :
global $wpdb;
$array_liked_post = $wpdb->get_results( “SELECT post_id
FROM “.$wpdb->prefix.”ulike
WHERE user_id = ‘$author_id’
AND status = ‘like'”
);
// convert object result to an array of post_id
$array_liked_post = array_map(function($oObject){
$aConverted = get_object_vars($oObject);
return $aConverted[‘post_id’];
}, $array_liked_post);
after you can make a wordpress query with ‘post__in’ => $array_liked_post
That will give you the post liked by the user
$args = array(
‘post_type’ => ‘post’,
‘post__in’ => $array_liked_post,
‘post_status’ => ‘publish’,
);
with that can make a shorcode or a function . Hope can help..