0

I am trying to create a table that is populated by the users: name, points, training completed. All of this data is in the users admin section. Is there a plug in or code I can look at to understand how to create this?

EXAMPLE:

enter image description here

1

1 Answer 1

0

See how the data is stored in the database in the table "wp_usermeta"

Find the storage keys for "points", "training completed"

Then using the function

https://codex.wordpress.org/Function_Reference/get_users

$users = get_users( $args ); 

foreach ( $users as $user ): 

    echo $user->ID;

    echo $user->display_name ;

    echo get_user_meta( $user->ID, 'KEY_POINTS', $single = true);

    echo get_user_meta( $user->ID, 'KEY_TRAINING_COMPLETE', $single = true);
endforeach;
2
  • I can not find the user data in the wp_usermeta. The data is in the user profile is there some other place it could be located in?
    – Brian_B
    Aug 10, 2018 at 15:41
  • display all user fields by id $um = get_user_meta ($user->ID); var_dump ($um); Aug 10, 2018 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.