Problem with user_mail in functions.php
-
Hey guys, i have some issues with this thing here:
add_shortcode('authors-list', 'my_authors_list_shortcode'); function my_authors_list_shortcode( $atts = array() ) { global $wpdb; $users = $wpdb->get_results( "SELECT ID, display_name FROM {$wpdb->users}" ); $content = "<ul class='authors-list'>"; foreach( $users as $user ) { $content .= "<li>"; $content .= get_avatar( $user->ID, 70 ); $content .= "<h3>" . $user->display_name . "</h3>"; $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'description', true ) . "</p>"; $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'phone', true ) . "</p>"; $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'livingplace', true ) . "</p>"; $content .= "<p class='author-description'>" . $current_user->user_email . "</p>"; $content .= "</li>"; } $content .= "</ul>"; return $content; }
It seems like there is no way to output all users email adresses.
Any one got an idea ?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Problem with user_mail in functions.php’ is closed to new replies.