* Add filter to redirect user to a particular destination on
* login based on their roles.
*/
-/*
-function my_login_redirect( $redirect_to, $request, $user ) {
-
- global $user;
- // Do we have a logged in user
- if ( isset( $user->roles ) && is_array( $user->roles ) ) {
-
- // If this is a non-contact user or one with a pre-existing non-contact login
- foreach ($user->roles as $r) {
- if (substr($r,0,12) != 'glm_members_') {
- // Go to normal destination for this user
- return $redirect_to;
+function my_login_redirect( $redirect_to, $request, $user ) {
+ if (get_option('glm_member_db_frontend_login_request') == false) {
+ update_option('glm_member_db_frontend_login_request', true);
+ global $user;
+
+ // Do we have a logged in user
+ if ( isset( $user->roles ) && is_array( $user->roles ) ) {
+
+ // If this is a non-contact user or one with a pre-existing non-contact login
+ foreach ($user->roles as $r) {
+ if (substr($r,0,12) != 'glm_members_') {
+ // Go to normal destination for this user
+ return $redirect_to;
+ }
}
- }
- // If we get here, this is a pure contact user, start them at their profile
+ // If we get here, this is a pure contact user, start them at their profile
- return '/wp-admin/admin.php?page=glm-members-admin-menu-member';
+ return '/wp-admin/admin.php?page=glm-members-admin-menu-member';
+ }
}
// No logged in user - So why is the "login_redirect" filter triggered anyway?
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
-*/
+
?>
\ No newline at end of file
// Add content to member detail page
-add_filter('glm-member-db-admin-management-hoooksHelp', function($content) {
+add_filter('glm-member-db-admin-management-hooksHelp', function($content) {
// Read in this plugin/addon hook help file
$fname = GLM_MEMBERS_CONTACTS_PLUGIN_PATH.'/setup/hooksHelp.html';