Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

How to get members by level id

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › How to get members by level id

Tagged: members, wp membership

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 4 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 1, 2014 at 10:59 am #11718
    ash
    Member

    Hi,

    I was looking at the tweaks posted in https://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248 but can’t find my answer.

    How can I get all members that are part of a specific LEVEL ID?

    something like wp_member_get_members_by_level(LEVEL_ID) which would return an array of member objects or an array of member ids.

    Help is appreciated. Thanks!

    November 1, 2014 at 11:21 pm #66519
    admin
    Keymaster

    Here is an example snippet of code that will retrieve all members from a particular level:

    $level = "2";//Membership Level ID in question
    global $wpdb;
    $sql = $wpdb->prepare("SELECT member_id from " . WP_EMEMBER_MEMBERS_TABLE_NAME . " WHERE membership_level=%d", $level);
    $members = $wpdb->get_results($sql);

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ