Custom User Profile Fields

You’re going to definitely want to do this with a plugin. Modifying WordPress Core files is an extremely bad idea as others have pointed out because every update will wipe them out and future versions may change the location/function of what you’re editing. You can get away by adding it to the theme’s functions.php file … Read more

WordPress User getting added with id of 0

The ID column if the wp_users table is the Primary Key and auto-incremented. If your table isn’t set that way then something must’ve gone wrong while it was getting created. Try deleting all the tables from the database and re-installing WordPress.

List User order by ID in Descending order (Backend)

I first thought that pre_user_query would be that hook for the job. But I think using the equivalent of pre_get_posts, which is pre_get_users, would be suitable here. You also said you wanted to run this in admin. So we will check that before running this. function my_custom_order_users_by_id( $query ) { //Check that we are in … Read more

Redirect users based on custom field

According to your functions, if you want to redirect users when they are visiting the website’s homepage. You could implement the is_front_page() function to detect and only redirects if they are on the frontpage. function user_homepage() { if ( is_user_logged_in() ) { $args = array( ‘field’ => 25, ); $user_homepage = bp_profile_field_data( $args ); if … Read more