Opened 11 years ago
Closed 10 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_sitemeta
fortestdomain
ashttp://src.wordpress-develop/fake/login/redirect
mu-plugins/index.php
http://src.wordpress-develop.dev/wp-login.php
http://src.wordpress-develop/fake/login/redirect
as expected.Can you provide more detail on what fails?