You can create a new user role or set user access level, if you wanted for large group of user.
If not you just go with the normal way of adding the menu. But in printing the admin page just make sure that current user is what you are expecting to see the page.
EG:
add_menu_page( $page_title, $menu_title,
$capability, $menu_slug, 'sample_function', $icon_url, $position );
function sample_funtion(){
$allowed_user_list = array(2,18);
$current_user_ID = get_current_user_id();
if(in_array($current_user_ID,$allowed_user_list)){
//now print everything you want. Only allowed user will see it
}
}
Related Posts:
- How to check username/password without signing in the user
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- WordPress REST API call generates nonce twice on every call
- Custom user profile, registration, login page with theme
- How to use WP default post list tables in a plugin?
- How to add quick edit and bulk edit fields to users admin section
- Generating User(s) with Settings API
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- Print WordPress username id inside JavaScript
- Function Get User Object By Username?
- Check if someone is editing a post (this content is currently locked)
- Modify users.php page to create page/post on button clicked
- Subscribe to author?
- How to filter users list on user_status field with get_users()
- Frontend language per user
- Display custom fields in frontside user profile
- global $current_user not current user
- Display list of uploaded images, filtered by user under a specific user group
- What is the proper way to get logged in user id in a plugin?
- How to build a fool proof AdSense revenue sharing model?
- Hide custom post type by user roles
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- First and last name fields not filled when using wp_insert_user
- Wp-admin Custom User Management
- get author of published post
- How to get custom post_author?
- Associate multiple email addresses with the same user account, so they can log in with either
- Update a user profile via frontend
- Best practice for Designing a Plugin with this scenario
- Adding another field to user table
- how to get the top 10 popular blogs
- How can I change my assigned user role in WordPress 3.5.1?
- How to relate the Category to user?
- Adding a dropdown on the user admin
- Allowing duplicating users with same user_login and user_email
- Why User_login key doesn’t work with wp_update_user()
- How to grab data after wp user search is complete
- How to prevent users from deleting their accounts?
- User Registration Moderate
- How to retrieve custom profile fields associated with different users
- Upgrade routine: Interaction with user confirmation
- Multiple Users Logged In Causing Incorrect Account Returned
- first_name property missing inside register_user action hook
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- Create Unique and Customized User ID for Website Members in WordPress
- How can a plugin create a page/form in the front end?
- Looking for WordPress System Diagrams
- Init action hook running late after PayPal’s return url?
- Get specific color from admin color scheme
- How do you create a custom edit.php / edit pages page
- Check the Version of an Enqueue’d External Library
- Edit the output of wp_widget_rss_output()
- How to Parse an Array of Elements in Gutenberg Block
- Custom rewrite rule serves content, but returns 404 error code
- How to edit mySQL wp_posts table from plugin php?
- Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?
- WP_Query with tax_query, order by most ‘matches’
- Using the Settings API, how should I add multiple values to an option?
- WP custom menus error > menu name already exists?
- Problem with is_active_sidebar?
- How to sanitize user input?
- Remove Internal Style Sheet if no Value Provided?
- Widget update function not saving values
- get_the_excerpt() is not returning an empty string when the_excerpt is blank?
- “Plugin could not be activated because it triggered a fatal error.”
- Storing product price data in the database
- Does the order of sections in readme.txt matter?
- Correct check for any admin page with editor
- Add column in WP user but it goes wrong
- modify wordpress default search
- How to perform a heavy and long process in cron jobs?
- Woocommerce extend tax report with custom column
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- Hook into Jetpacks Publicize without using a post type
- How to limit number of number of categories displayed by categories widget
- Is it necessary to do validation again when retrieving data from database?
- Using WordPress PHP code, how to bulk delete only 100 subscribers at a time from thousands of users?
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- term_exists() returning NULL on term that exists
- WP nonce field checkbox prints checked=’checked’ outside input field
- Make dynamic string translatable
- Creating two tables in database on activation hook
- How to receive notification of deprecated API elements and functions?
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Change reminder email date to 14 days before
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Adding Amchart Interface to WordPress API
- WordPress Own Rewrite Rules
- Don’t print customizer styles when no setting has been used
- Buddy Press restrict the capability to edit users
- Plugin with functions inside a class & how to trigger WP CRON
- add_settings_error on validating plugin options API
- Problem to return more than single line captions
- Unable to show a message after plugin activation
- How to get an array out of a nav menu if it’s a plugin?
- Can I access WordPress API’s from within plugin scripts?
- Is there a way to make is_search() always return false
- Ajax url value to pass ‘variable’ to use in query
- Apply Filters Causing a 500 Internal Server Error