WordPress.org

Ready to get started?Download WordPress

Forums

Select all users who are members of any of the blogs for which I am registered (1 post)

  1. plugins_lexblog
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to populate a list with the email addresses of ALL users who are registered for ANY of the blogs for which the current user is registered.

    I'd like to do this in the most efficient way possible, which I think would be a join. My outline:

    1. Run get_blogs_of_user() http://codex.wordpress.org/WPMU_Functions/get_blogs_of_user to get an array of objects representing the blogs for which the current user is registered.

    2. Do the necessary handling to convert this into the proper WHERE ... OR ... OR query string.

    3a. Run a join to...

    SELECT user_email
    FROM wp_users
    WHERE ...

    Ah, I'm falling apart there. In general...

    consult the wp_blogs table to get the domain of the blogs for which I am registered
    consult the wp_signups table to get all the users of each of those blogs
    consult the wp_users table to get the emails of all of those users

    Can anyone help me flesh that out?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by plugins_lexblog
  • This topic is not resolved
  • WordPress version: 3.4.2

Tags