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
- What process do you use for WordPress development? [closed]
- Where to put third party PHP library?
- Add a new tab to WordPress Plugin install Listing
- Scheduled events disappear from events queue
- How to integrate a PHP webmail script into the backend of WordPress?
- Custom Post Type Link from Plugin
- How to Get a List of Sub Blogs without Using get_blog_list()?
- Conditional check to see if a bootstrap.css is included in a theme
- Create Element From Dynamic HTML String [closed]
- what is the best practice for including ‘wp-includes’ classes
- Custom Plugin Database relations
- Save user-specific options in WordPress admin
- How can i get the title i specified in add_options_page for my header
- use __($str) to translate strings (symfony/twig)
- Is there a way to list tags order by post_meta field
- Proper way to run wp_query from inside a plugin
- Buddypress function and global $bp question
- How to create a table with filters for my plugin
- Maximum lifetime for nonce
- How to setAttributes in Gutenberg block?
- Adding rewrite rule dynamically
- Using a multiple element in widget form
- How can I avoid conflicts between plugin and theme?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- $wpdb->prepare with LIKE and sprintf
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Quasi-custom API Call Plugin
- Show content without a post
- WP ajax requests not stacking?
- Is it possible to load the css just on my plugin admin page?
- How to create taxonomy without using register_taxonomy () function
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- How to change a field in database through a submit button or Checkbox? [closed]
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- Import images remotly run through timeout error
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Load specific page when a custom URL is hit
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- Trying to rename a file upload as the hash of file content on wordpress
- Getting products information, in woocommerce based on products ID
- How can I measure CPU and RAM used by my theme or plugin
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- Modify search form with plugin
- How to display properly exception or echo string after posting in plugin?
- On one of my sites a file is shown as 404 but the file IS there
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- multiple record insert creating many duplicate records