Hy, I am working with wp job manager, and I would like to list job applications by user, under ultimate member tabs. I have tried using this code, but it shows me all applications
function custom_shortcode() {
$args = array( 'post_type' => 'job_application',
'author'=>$author_id, );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
echo '</div>';
endwhile;
}
add_shortcode( 'query_my_posts', 'custom_shortcode' );
Also i have tried this method https://suiteplugins.com/how-to-change-the-post-type-on-ultimate-member-posts-tab/
But no luck, any help?
$author_id
somewhere -- as your code stands, I'd wager it's undefined. I'm assuming you want it set to something likeget_current_user_id()
.