create a table using user meta custom data

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 = … Read more

Get user active posts randomly

But i can’t pass an array to it.I have a solution for getting the post randomly if am able to remove array elements form $user_ids by checking with product ids. Yes, the wc_customer_bought_product() function only accepts a single user/product ID. But you can loop through the $user_ids array, and for each user (ID), loop through … Read more

wp_insert_user always tries the same user name

Before doing anything, make sure that the user account doesn’t already exist. This is really easy to do with the username_exists function. if( null == username_exists( $username ) ) { echo “user not exist”; } use the above code and see what happen then do as below $user_id = wp_create_user ( $email_address, $password, $email_address ); … Read more

Simulate Update User button click

Thanks must go to WebElaine as her comment lead me on the right path to solving this. The issue was when the pmprommpu_addMembershipLevel() adds the membership level it sets the endate to 0000-00-00 00:00:00 running a $wpdb->update to set this to NULL fixed the problem.

Redirect /member/ to /member/user

You could hook into template_redirect action hook and redirect the users. I assume that you want to redirect the currently logged in user. add_action( ‘template_redirect’, ‘wpse314345_redirect_users’ ); function wpse314345_redirect_users( $template ){ // Check if the user is logged in if( is_user_logged_in() ) { // Get the current user $user = wp_get_current_user(); // Redirect the user … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)