Problem:
The user would like to programmatically get related posts that are created by the current user.
Solution:
That's not possible with the Toolset API. We need to, first, get the related posts, then we can use a wp_query to get the current user's posts within them. This is an example code:
$applications = toolset_get_related_posts($post->ID, 'job-to-job-application', 'child');
$posts = get_posts(array(
    'author' => get_current_user_id(),
    'post__in' => $applications
));
if( count( $posts ) > 0) {
    echo 'View Application';
}
else {
    echo 'Apply';
}
Relevant Documentation:
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat | 
|---|---|---|---|---|---|---|
| 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9:00 – 13:00 | 
| 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - | - | 14:00 – 18:00 | 
Supporter timezone: Africa/Casablanca (GMT+01:00)
This topic contains 2 replies, has 2 voices.
Last updated by 4 years, 1 month ago.
Assisted by: Jamal.