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
- Add custom css to specific user
- different style sheet for just one page template
- How to retrieve the current post’s generated featured image size?
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- Why There Is No “get content by ID” Function
- Custom HTML markup
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- How to Use Global Variables Inside Header and Footer
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- Secondary Menu and Logged In Users
- Why get_user_by() doesn’t work in my code?
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Where do I go to edit this area? [closed]
- Filter to wp_list_authors
- Replace plugin function with a custom function?
- Add attribute only to first image of every post via functions.php
- Different favicon on different pages
- The_content and Preg_replace in loaded Iframe [closed]
- How to add array [closed]
- Add Link to Users List (Backend) to open each users front-end profile
- Problem with images URL after filter applying
- Suggest Users basing on User taxonomy
- two search forms on the same page
- Showing user profile data on front-end
- Function to replace comment’s accented characters before posting
- Modify function to only return values for the user that’s logged in
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- how to display a page before the home page
- User meta and public function security
- call wp_insert_user in custom class doesnt work
- Get users with different roles and call function on each of them (user_meta)
- Show errormessages on wrong username/password on custom loginform?
- Function to check if custom page is used by page?
- How can I show different content for different user-levels?
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Custom user role still showing up after deletion, ideas?
- referencing the current user in a page i created in wordpress
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Show metadata in users.php – wordpress
- How to remove font awesome from loading in wp theme
- How to replace ACTION url from original wordpress login form?
- Header menu aligned right on all pages except for single-post page [closed]
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Deleting guests profile users after 1.5 hours
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- 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
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- 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 Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- How would I correctly implement a new if statement in a child functions file?
- Woocommerce custom calculation function
- Remove all video attachment, both files and post/postmeta from database?
- WordPress Ajaxifying not working properly
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Show users last read posts for each user?
- True email confirmation for registration (keeping unvalidated users from user table)
- Replace image attributes for lazyload plugin on image elements with specific class
- Adding A New Widget to WordPress Disables the Existing Widgets
- How To Show Shortcodes In WordPress Custom Fields?
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How to make an If Else on Excerpt Filter
- How to replace words in my posts and saved new words
- 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
- Add functionality to post editor
- 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
- functions.php / replacing div’s with new ones?
- Why does modifying my functions.php file always result in a server error
- Display a list of users with avatar filterable with alphabets
- get USER ID in functions.php using user_register action
- Post variables not displaying correctly in custom function
- Remove snippets of JS from core