PHP 29
Wordpress list users with php By micha on 11th June 2023 05:35:08 PM
  1. <?php
  2.  
  3. /*
  4.  * URL to call: {DOMAIN}/wp-content/themes/{THEME-NAME}/adminscript/list-users.php
  5.  */
  6.  
  7. require_once("../../../../wp-load.php");
  8.  
  9.  
  10. $users = get_users( array( 'fields' => array( 'ID' ) ) );
  11.  
  12. foreach($users as $user){
  13.         echo '<pre>';
  14.         echo '<h1>ID: '.$user->ID.'</h1>';
  15.         print_r(get_user_meta ( $user->ID));
  16.         echo '</pre>';
  17. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.