You can use meta_query to specify what conditions you want to meet with that query you are performing. i.e.:
// grab some record from DB with a specific meta query
$args = array(
'post_type' => array( 'woo_commerce_something' ),
'orderby' => 'rand',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'meta_something_woo_commerce_email',
'value' => 'email@[email protected]'
)
)
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
// do something
endwhile;
endif;
wp_reset_postdata();
Related Posts:
- Make WooCommerce pages accessible for logged in users only
- alphabetically order role drop-down selection in dashboard
- How to update user role without logout
- How to order users alphabetically by their last name?
- order users with drag’n’drop?
- Add user data to table when user is created?
- How to add a user profile page to frontend?
- Allow unfiltered HTML for not logged in users when saving a post
- meta_query orderby sort multiple keys
- Custom registration fields not appearing in user info
- User list order by user meta
- How to order posts by the user_login that corresponds to a meta_value (which is a user id)?
- Sort users by custom user meta value
- How-To: Get meta data from the users last order in woocommerce
- hide woo commerce dashboard status and reports from woo commerce from specific users but display to other users
- sort by date in users
- Confirmation required on email change
- Email user when password is reset by admin
- How to work around “that email address has already been used” error?
- How can I run a WP-CLI command as authenticated user?
- LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?
- Upload gravatar in WP profile?
- Recover the user that have been deleted
- WordPress edit_user_profile_update update secondary role
- Order get_users() by last login date. Is it possible?
- Check if user is online?
- How to check that if current user (ID) has posts or not
- How to get the Role Name of the current user? (WordPress)
- how to get recent registered author id?
- Is it possible to duplicate users on a new WordPress install?
- Why don’t first_name and last_name appear when you print_r the WP_User object?
- How to use search_columns in WP_User_Query?
- Authenticate with a Rails app?
- Send Email to Users after Deleting Account
- How to add local users to wordpress without email password?
- WP User Query fails when searching meta queries and search columns
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Call to undefined function wp_insert_user()
- *wpupdateuser* user_login in my WordPress database
- Limiting woocommerce line_total decimal length
- Updating user meta
- Changing a username
- Change the user_login at registration
- Error: How to allow the “contributor” to upload media in wordpress
- Delete users from multisite after they have not logged in for a set amount of time?
- Where is the information about the authors for articles stored?
- Restrict access of admin uploads to certain logged-in users?
- how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
- Find user by nicename and open profile
- Using Cloudflare caching on wordpress with front-end user logins
- Custom default filtering in the user admin panel disables the other sortable columns
- Reset Password policy
- Is possible to allow user to login with different role?
- Creating user without username and password
- Is this code true or not
- Check for valid email after user inactivity?
- How do I let contributors edit their posts after being approved once?
- Custom Comment Notifications Fire on each Page Load
- The Simple and Correct Way to Add User Meta
- how to set default update_user_meta values wordpress
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- Get user id after save post
- Redirect user to login if not logged in, on specific pages
- Check if user is logged in via JS? [duplicate]
- Make new users automatically approved
- Adding fields to the “Add New User” but the form data not saved into DB
- Admin approval for editing user profile
- How would I restrict certain user levels from editing categories
- How can I set wp_dropdown_users so that it shows only authors?
- Editor role can only create/edit/delete users who have one of two roles
- WordPress 5.8 – Hide or Remove personal fields from admin Profile page
- Switch to user link shortcode
- Restricting wordpress login sessions for a web app
- change user password REST API
- Use WP cookie to authentificate user on an external app
- Find count of WordPress users by role and search string for user name
- Append USER ID to an outbound link?
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- How do I add profile fields in specific section?
- Users activity history
- How to destroy all user sessions via WP-CLI
- Is a list of user names or IDs in a custom profile field the best way to create a followers list?
- is_user_logged_in() not working after domain change
- Get the author registration date in the header.php file
- Front end login and page restriction
- Designing a member area on my site
- Link to Authors blog posts
- view and update form only for registered users
- Redirect based on log-in status per JavaScript
- i need to let a user to add a role from a frontend form
- Integrating Facebook Registration (and Login) on a WordPress page
- Product atributes in title of order (not in description)
- Woocommerce – Display product category of product in Orders page
- WordPress C# User Login
- Create users from frontend without password
- How to get user contact info
- Why does a super admin on multi site get a rest_user_invalid_id error code when requesting user details through REST?
- How to track all users logged into a site?
- Export user data from Squirrly’s Starbox plugin?
- using custom pages for myaccount in woocommerce