I’d assume that $specific_admin_usernames is an array– so there’s no need for this line $specific_admin_usernames_imploded = implode($master_admin_usernames);
Also your if statement is a little backwards. PHP’s in_array( $needle, $haystack) doesn’t need the $current_logged_in_user !== part. Try:
if ( in_array($current_logged_in_user, $master_admin_usernames) ){
// this runs when the current user is IN the master list
}
Related Posts:
- Passing arguments to a admin menu page callback?
- Admin settings update updating every time home page is hit?
- What’s the best method for emptying an option created with the Settings API?
- What is the recommended way to create plugin administration forms?
- How to add a new plugin page under desired Options page?
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- Overwriting Core WordPress Functions with Plugins
- Naming Admin Menus and Submenus
- Current class on admin menu using add_submenu_page()
- Add Admin Menu Inside Construct or Init
- Hook event for upload image in the menu
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- add_menu_page() with function inside a class [duplicate]
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How to put placeholder text in the main post input area?
- Unified Approach for Placing Option Pages
- Plugin with specific admin menu icon
- OOP Plugin and Menu – Call to undefined function register_setting()
- Global State During an Admin Post
- Howto: Use Custom Post Types as Submenu Items in Admin
- Sub Menu content is being duplicated
- Set different custom menu items for different user roles
- Show/Hide ‘add new user’ custom fields in wordpress admin panel by click another field
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- is it recommended to use WP_List_Table?
- Plugin sub-menu pages recommended structure and links
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- Add a page in admin without adding menu item
- Silently register plugin pages
- WordPress theme options Menu
- Print Dashboard submenu name and filename
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- Unable to get a simple plugin admin page to work
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Use options to control jQuery plugin
- Restrict certain actions to plugin-specific admin menu pages only
- Proper way to create an administration page without adding it to the menu
- Pause plugin option page until all data manipulation is complete
- How to add text editor in plugin menu?
- How to make an admin plugin menu page go full screen?
- How to add admin.php to WP Admin Menu Link
- Convert each new line in the textfield as a new value in an array
- How put the correct URL to sub-menu plugin?
- Developing a plugin where users can edit entries saved in database
- Add a description/hint field in the admin page of a plugin
- Forcing ALL plugin Admin menus into a separate menu
- Link to a admin submenu item using a custom link
- Plugin admin list pages as submenu
- Change Admin menu placement using hooks
- Menu_slug used for creating options page
- How to design WooCommerce-like admin tabs for plugin settings page?
- Show Admin Menu
- adding an options menu that allows saving multiple sets of said options
- How to connect my wordpress plugin to a remote database securely?
- How to create a backend for a custom theme?
- admin_post equivalent for guest user?
- WP Cron being triggered but not working as expected
- Plugin Options Array Set to Undefined
- is pre_get_comments not working?
- When echoing my own shortcode, it keeps adding a 1 at the end of my blogpost
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- unregister_setting() vs delete_option() for plugin update
- Get thumbnails with array sizes parameter
- add_filter img_caption_shortcode not implemented
- How to add Plugin functionality in WordPress Frontend Menus
- Get post thumbnail in WP_Query
- Unexpected T_FUNCTION
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- Plugin can’t be activated [closed]
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Is there an action_filter hook to add content before the post title?
- CSS not being applied using wp_enqueue_style
- wp_schedule_event not executing function call, even with add_action
- How to query a nested field in wordpress api using _fields param
- function add custom fields to media gallery
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Add quick edit functionnality to plugin table
- Hide / show settings field based on other field’s value
- using wordpress acf shortcods in tables goes outside the table
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- remove different admin menu for specific users
- add pagination to wp_remote_get
- Not able to Update database while creating a custom module
- How to load css file after a certain css file
- Shortcode from a plugin not working
- How to get option values without requiring wp-load?
- Problem with baseurl and interaction with plugin
- Why setcookie function redirecting to home page in wordpress?
- Deactivate Other Incompatible Plugin Upon Activation
- Should all roles be allowed CRUD operation on the database?
- Downloading Generated XML File
- Can’t get query string in ajax call
- Pass results of custom query to loop – when writing a plugin
- How to use permalink query to go to specific tabs in posts
- Conditional query tags do not work before the query is run. Before then, they always return false
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- WP Cron registers hook without any action (does not call the function)
- Send Webhook when post-status is publish or trash