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

Is it possible to have a network of BuddyPress sites, a-la WordPress MU, with single-sign-on? [closed]

BuddyPress is compatible with a WordPress Multisite setup. There are several different ways to set it up. By default, BuddyPress data is stored in a networkwide way. Generally, that means that, within the network of sites, only one site is dedicated to BuddyPress features/content – you might think of this as the “community” site within … Read more

How to get the ID of the currently logged in user?

get_current_user_id() effectively does what @Giri had described in the first snippet. The internal WordPress function-call chain eventually calls get_currentuserinfo() which already checks if there is a WP_User object, meaning a user is logged in. Thus, from what I can see in the linked code, get_current_user_id() always returns the ID of the user that is logged … Read more

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