Opened 13 years ago
Closed 11 years ago
#25793 closed defect (bug) (invalid)
In a multisite, get_site_option() doesn't work in login_redirect filter
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.6.1 |
| Component: | Options, Meta APIs | Keywords: | reporter-feedback |
| Focuses: | multisite | Cc: |
Description
The following code fails :
function dessange_login_redirect($redirect_to, $request, $user)
{
return get_site_option(OPT_SITE_URL);
}
add_filter('login_redirect', 'dessange_login_redirect', 1, 3);
unless I connect $wpdb manually before calling get_site_option(), like in the following code
function dessange_login_redirect($redirect_to, $request, $user)
{
global $wpdb;
$wpdb->db_connect();
return get_site_option(OPT_SITE_URL);
}
add_filter('login_redirect', 'dessange_login_redirect', 1, 3);
Change History (3)
Note: See
TracTickets for help on using
tickets.
I'm not able to reproduce an issue in current trunk.
wp_sitemetafortestdomainashttp://src.wordpress-develop/fake/login/redirectmu-plugins/index.phpdefine( 'OPT_SITE_URL', 'testdomain' ); function dessange_login_redirect($redirect_to, $request, $user) { return get_site_option( OPT_SITE_URL ); } add_filter( 'login_redirect', 'dessange_login_redirect', 1, 3 );http://src.wordpress-develop.dev/wp-login.phphttp://src.wordpress-develop/fake/login/redirectas expected.Can you provide more detail on what fails?