WordPress query with search and subscribers only output

I cant understand how to make query:

    $start_from = something;
    $results_per_page = something;

    $nameinput= '%' . $wpdb->esc_like($searchinput) . '%';
    $emailinput= '%' . $wpdb->esc_like($codeinput) . '%';

    $users= $wpdb->get_results($wpdb->prepare("SELECT * FROM hp_users WHERE display_name like %s OR user_email like %s ORDER BY ID DESC LIMIT 
    $start_from,$results_per_page", $nameinput, $emailinput));

And I also need these users to be subscribers only. Thats I cant do.

Would be glad for any help.

Read more here: WordPress query with search and subscribers only output

Leave a Reply

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