Is there a way that we can change wordpress user id?

simply change the autoincrement number in your table settings in phpmyadmin to 387100 and it will start and go ahead with 387101, 387102, and so on. As it automatically counts +1 when adding a user, this is the most efficiant and easy way to do it without changing any code.

wp_user_meta doesn’t return data in a foreach loop

Use this code instead- $args = array( ‘meta_key’ => ‘last_name’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’ ); $users = get_users( $args ); foreach ( $users as $user ) { $user_id = $user->ID; $post_count = count_user_posts( $user_id ); if ( $post_count > 0 ) { $user_meta = get_user_meta( $user_id, ”, true ); echo ‘ID: ‘ . … Read more

Can’t display user bio

I’m not certain as I have no experience of ACADP, but I suspect your problem is the function, acadp_get_user_slug. What does it do? Likely not what you think! As the following will work for the user admim: function display_user_bio() { $user_slug = ‘admin’; if($user_slug != ”) { $user = get_user_by(‘login’, $user_slug); if($user) { return get_the_author_meta(‘description’, … Read more

Find matches of a variable in custom usermeta

You can use WP user query. Assuming that your meta_key is authmeta you can use the following code to find the users with meta key authmeta and value of your $var variable. $user_query = new WP_User_Query( array( ‘meta_key’ => ‘authmeta’, ‘meta_value’ => $var ) );

Update another users meta

wp_ajax_nopriv_{$action} can trigger a non-logged in ajax request. add_action( ‘wp_ajax_nopriv_add_foobar’, ‘prefix_ajax_add_foobar’ ); function prefix_ajax_add_foobar() { // Handle request then generate response using WP_Ajax_Response } get_user_by can pull the user’s data via email $user = get_user_by(’email’, ‘[email protected]’) update_user_meta can update the user’s metadata. update_user_meta( $user->ID, $meta_key, $meta_value, $prev_value );

Custom user meta values in shortcode

You didn’t mention whether users could only reach this page when logged in, so this example includes a check to make sure the current visitor is logged in, otherwise it won’t output anything. <?php // create the shortcode add_shortcode(‘wpse_312268_show_cc_info’, ‘create_wpse_312268_shortcode’); function create_wpse_312268_shortcode() { // only do something if user is logged in if(is_user_logged_in()) { // … Read more

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