how to add radio field on user meta on function.php?

You are using the wrong name on the radio inputs, radio-inline but when you try to get that value you are using $_POST[‘gender’] I’ve updated you code and made some improvement too, with the checked() function function show_extra_profile_fields( $user ) { $gender = get_user_meta( $user->ID, ‘gender’, true ); ?> <section> <label class=”label” for=”gender”>Gender</label> <div class=”inline-group”> … Read more

how to show all type of author posts in author page (SOLVED)

If you use WordPress author template to show user posts ( example.com/author/{user_name} ) the best solution will be to change the main query via the pre_get_posts filter hook. function se339534_author_any_post_types $query ) { // apply changes only for author archive page if ( ! is_author() || ! $query->is_main_query() ) return; $query->set(‘post_type’, ‘any’); } add_action( ‘pre_get_posts’, … Read more

Is possible to modify user_login after registration?

WordPress does not allow updating user_login for existing users. You may update it using $wpdb->update as below: // Sanitizes the username $user_login = sanitize_user( trim( $user_login ), true ); // Check if the given username exists if ( ! empty( $user_login ) && ! username_exists( $user_login ) ) { global $wpdb; //Update user record $wpdb->update( … Read more

List all authors by matching custom meta data on a category page

Try the WP_User_Query, something like: $term = get_queried_object(); $users = new WP_User_Query(array( ‘meta_key’ => ‘your_meta_key’, // the key in which you store your terms ‘meta_value’ => (int)$term->term_id, // assuming you store term IDs )); print_r($users->get_results()); A update based on your input: $term = get_queried_object(); $user_query = new WP_User_Query(array( ‘role’ => ‘subscriber’, // or whatever your … Read more

buddypress edit profile [closed]

I managed to use $bp->template_message this was a bit tricky but then I had to go to bp-xprofile-screens.php just under line 77 I added unset($is_required[1]); to remove the username update, (as this does not need changing) 🙂 hope someone else, may find this useful.