Home › Forums › General Issues › Use get_field for data from particular post AND specific author › Reply To: Use get_field for data from particular post AND specific author
Hi @fontsnob
You can use get_post() and wp_get_current_user() to check the author and the current user. Something like this:
$otherPost = get_post($post_id);
$currentUser = wp_get_current_user();
if($otherPost->post_author == $currentUser->ID){
//do something if current user is the post author
}
Hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.