You do not want an OR, you want an AND.
Follow it through and substitute the values. If we are user 1, then it’s true because we are not user 2, and true OR false resolves to true. Only one of them needs to be true for an OR to be true. If we are user 2, then it’s true because we are not user 1, and false OR true also resolves to true.
Remember, a or b
is true if A, B, or both are true. I know what you meant, but the computer does not, and you have to be extremely exact.
When you say I do not want A or B, what you really meant was I do not want A and I do not want B.
so replace this:
if user is not 1 or user is not 2
with:
if user is not 1 and user is not 2
Or better yet:
if user is not in this array [ 1, 2]
Related Posts:
- Remove the deleted users avatar from list
- loginout function customization
- Adding fields to the “Add New User” screen in the dashboard
- When should you, and when should you not, use wp_list_pluck()?
- Display random categories on the front page (Finding and Editing Theme Functions)
- Use author author display name in permalink structure for pages and posts
- Get a list of all available fields in the User Profile
- How to paginate the get_users function?
- Woocommerce add to simple product attribute programmatically [closed]
- How to manually activate user in dashboard only by admin
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- wp_delete_user with username
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Order get_users() by last login date. Is it possible?
- Set default options for inserting media
- Default or Preset Content for Custom Post Types
- Remove tag on my RSS Feed
- How can I tell when a user is logged in?
- how to get and display logged in user’s recently read posts
- How to detect first visit of a user?
- Set user loggin status?
- Theme-Config tab in admin Pannel?
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Delete pages and Create default pages for all new network sites
- Actions according to image type and size
- Post thumbnail relative link and HTML modify
- How to mass-delete inline styles in WordPress custom post type automatically?
- How would go about if I just want a temporary function?
- How to call custom function from functions.php in site-wide template files?
- PHP files included in functions.php don’t seem to work
- How Can I Expand the WordPress Customize window without any Plugin?
- Get Current User info using wp_localize_script, in functions.php
- Set quantity of woocommerce product on page visit [closed]
- str_replace function in theme
- Don’t delete a page if it holds users
- Right way to update widget on dynamic new input field
- How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]
- Best practices regarding the creation of custom widgets?
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Word Press – Dynamic Content [closed]
- Change label for registration Fields
- Insert image in WordPress with HTML5 tag and caption function
- how can I just add to parent theme function(s) instead of redeclaring whole the function
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- How to retrieve the current post’s generated featured image size?
- Why There Is No “get content by ID” Function
- Custom HTML markup
- Use a shortcode to display custom meta box contents
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- How to append classname to body tag if guest user
- The_content and Preg_replace in loaded Iframe [closed]
- Suggest Users basing on User taxonomy
- two search forms on the same page
- Function to replace comment’s accented characters before posting
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- User meta and public function security
- call wp_insert_user in custom class doesnt work
- Function to check if custom page is used by page?
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- referencing the current user in a page i created in wordpress
- How to replace ACTION url from original wordpress login form?
- Header menu aligned right on all pages except for single-post page [closed]
- wp_get_current_user return ID = 0 when used outside of wordpress, such as webhook / fulfillment dialogflow
- Hide author info in single posts by certain users
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- CSS style and app.js not loading
- Allow user only create specific tags
- Add Change role button for list of user in an event
- get_current_user_id() always return 0 in if else statement
- Parent category as WOOCommerce Categories widget title
- Shortcode to insert default text and change one word throughout it?
- I want to customize the_posts_navigation function by replacing prev and next with images
- How would I correctly implement a new if statement in a child functions file?
- Show users last read posts for each user?
- True email confirmation for registration (keeping unvalidated users from user table)
- Adding A New Widget to WordPress Disables the Existing Widgets
- How To Show Shortcodes In WordPress Custom Fields?
- How to make an If Else on Excerpt Filter
- How to add number to wordpress count function?
- How do I integrate my Child Theme into a Custom Template?
- Shortcode to eliminate and replace with
- custom post with loading script per single post
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- child_of not working while searching
- How to request login for user but not for bots
- Display a list of users with avatar filterable with alphabets
- get USER ID in functions.php using user_register action
- Removing Facebook contact field from user contact not working
- How do I add functionality to images?
- WordPress Custom wp mail template return full template
- Problem with removing characters “<” – WpAllImport
- How to create a post without link in wordpress?
- multible shortcodes (for differnt values) with one function
- post_row_actions filter from parent theme not executing in child theme
- sort by date in users