Created
March 12, 2025 04:55
-
-
Save mclarenmervin/32c3f04c09db22ee4a6578ef461398a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Your_Class_Name { | |
public function __construct() { | |
add_filter('login_redirect', [$this, 'redirect_mervin_admin_users'], 10, 3); | |
} | |
public function redirect_mervin_admin_users($redirect_to, $requested_redirect_to, $user) { | |
if (isset($user->roles) && is_array($user->roles) && in_array('mervin_admin', $user->roles)) { | |
return 'https://www.mervin.in/staging/dashboard/?section=home-section'; | |
} | |
return $redirect_to; | |
} | |
} | |
// Instantiate the class | |
new Your_Class_Name(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment