Can’t get_users info by using json_encode

Try this code function get_users(){ $all_users = get_users(); $arr=array(); foreach ($all_users as $val) { $arr[]=array( ‘value’=> $val->data->user_nicename, ‘label’=> $val->data->display_name, ‘icon’ => get_avatar_url($val->ID)); } wp_send_json($arr); }

Insert user register into my own user table instead of wp own user

I figured it out myself I needed $wpdb and a , after the db_name Here is the result. $user_id = $wpdb->INSERT( ‘wp_fisker’, array ( ‘fisker_fornavn’ => apply_filters(‘pre_user_first_name’, $fisker_fornavn), ‘fisker_efternavn’ => apply_filters(‘pre_user_last_name’, $fisker_efternavn), ‘password’ => apply_filters(‘pre_user_user_pass’, $password), ‘telefon’ => apply_filters(‘pre_user_telefon’, $telefon), ‘zip’ => apply_filters(‘pre_user_zip’, $zip), ‘by_navn’ => apply_filters(‘pre_user_by_navn’, $by_navn), ’email’ => apply_filters(‘pre_user_user_email’, $email) ) ); if( … Read more

How to save dropdown slection by a user in the DB

You can update user meta either through custom code or using a plugin. Advanced custom fields will solve your issue. Check out the reference links for more info : https://support.advancedcustomfields.com/forums/topic/how-to-use-acf-to-add-user-profile-meta/ https://www.advancedcustomfields.com/resources/how-to-get-values-from-a-user/

Custom User Page

Try this : // The first part // add_filter(‘author_rewrite_rules’, ‘no_author_base_rewrite_rules’); function no_author_base_rewrite_rules($author_rewrite) { global $wpdb; $author_rewrite = array(); $authors = $wpdb->get_results(“SELECT user_nicename AS nicename from $wpdb->users”); foreach($authors as $author) { $author_rewrite[“({$author->nicename})/page/?([0-9]+)/?$”] = ‘index.php?author_name=$matches[1]&paged=$matches[2]’; $author_rewrite[“({$author->nicename})/?$”] = ‘index.php?author_name=$matches[1]’; } return $author_rewrite; } // The second part // add_filter(‘author_link’, ‘no_author_base’, 1000, 2); function no_author_base($link, $author_id) { $link_base = … Read more

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