I'm writing a code for author.php . I access this by: http://example.com/author/{user_nicename}
Imagine there are some users (Including 1 Admin, 4 or 5 editors, and so on ...)
Now when users click on above URL, They see their own Information.
I want to give permission to Admin and Editors to see the other arbitrary users Information.
How can i do that? This is a part of my code in author.php :
<?php
get_header();
$user_id = get_current_user_id();
global $wpdb;
$result = $wpdb->get_results(" SELECT display_name
FROM wp_introduction
INNER JOIN wp_users
ON costumer_id = ID
WHERE $introducer_id = $user_id" );
var_dump($result);
get_sidebar();
get_footer();
?>