Hi
I’m trying to grab the user_id from /wp_admin/user_edit.php?user_id=1234 and pass it to the relation/query/name=course filter so only courses by that user (they are the course author) appears in the pickable list displayed on it. User pages will be editable by any admin user so it can’t be via the current user id.
Essentially I need to substitute 1234 for $_GET[‘user_id’] or via another way but it does not pass it through. I can’t get the author id from $post_id as the user profile isn’t a post
add_filter('acf/fields/relationship/query/name=course', 'my_acf_fields_relationship_query', 10, 3);
function my_acf_fields_relationship_query( $args, $field, $post_id ) {
if ( IS_PROFILE_PAGE ):
$args['author'] = 1234;
return $args;
endif;
}
Any help would be much appreciated!