Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Retrieve Users Based on Meta Value

Posted on November 28, 2011 by Pippin in Advanced, Free Members, Member Restricted, Tutorials, WordPress Database, Working with Users 2 Comments
Home» Tutorials » Advanced » Retrieve Users Based on Meta Value
Tweet
Love It - 0

Just like the post meta system, WordPress has a powerful user meta system that allows developers to store additional “meta” information about the registered users in the database. This meta information can be just about anything you want it to be, and can serve a variety of purposes. At the time of writing this tutorial, I’m using the user meta system in my Pro version of Restrict Content to greatly expand the functionality of the plugin.


You must be logged in to view the rest of this content. Register or login from the sidebar.

Tweet Follow @pippinsplugins
meta_key, meta_value, users, wpdb

2 comments on “Retrieve Users Based on Meta Value”

  1. KCTeck says:
    December 1, 2011 at 2:46 pm

    We’ve talked offline previously about doing this sort of work. The site I’m working on now, would like to capture alot of data about our users. Things like address, retiree status, a thing called salary schedule (if the user is willing to give such info). So, if I’m reading this correctly, we need to capture all this info when the user signs up for the website, correct? The Login Form would need to have all this info – so we can push it to the database.? Then when you are running your sql – what are you pulling the data into? A WordPress form or a spreadsheet? I really need to dig deeper into this. Thanks again for your tutorials – very timely and helpful!

    Reply
    • Pippin says:
      December 1, 2011 at 2:54 pm

      All of the “meta data” can be set during registration using the update_user_meta() function. You could extend the fields created in the Registration Form Tutorial to include fields for the meta data, then update it when the user is created.

      When we query the users we’re not pulling them into anything really, just displaying them on the site. Though you could do whatever you wanted with them.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

  • User Follow System – Part 1
  • User Bookmarks for WordPress
  • User Submitted Image Gallery – Part 3
  • User Submitted Gallery Images – Part 2
  • User Submitting Gallery Images – Part 1

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Submitting Your First Pull Request to a WordPress Plugin on Github (1)

    Github is an extremely popular tool for managing WordPress plugins, and one...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

  • Plugin Development 101 – Intro to Loading Scripts and Styles (16)

    In this part of Plugin...

Enter your email to receive automated updates when new posts are published

Latest Tweets

  • @mintsupport Can you guys help me figure out why none of my @PayPal income has been tracked since April 4?
    May 18, 2013
  • Anyone else use @mint and see that it stopped tracking @PayPal income on April 4?
    May 18, 2013
  • @jeremyfelt granted!
    May 18, 2013

Topics

Tom McFarlin meta box add_shortcode attachments get_user_meta hook the_content wp_enqueue_script contextual help Sugar Event Calendar Rémi Corson shortcodes register_setting plugin login authors attachment do_action image Related posts forms mail chimp short codes post types bbpress apply_filters comments recent posts short code taxonomies custom post type gallery images Ajax Stripe taxonomy jquery widgets users add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2011 Pippin's Plugins