Changes between Initial Version and Version 1 of Ticket #2309, comment 3
- Timestamp:
- 04/24/2013 06:30:38 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2309, comment 3
initial v1 3 3 Please find solution extracted from a class of a plugin setting live dashboard language (backside). 4 4 5 '''Updated 2013-04-24 after a week tests:''' 6 5 7 First "brutal" workaround was based on removing filter: see commented lines below 6 8 7 Second approach was based on add of a filter action '''after_setup_theme''' to get user meta (here ''user_locale'') 9 Second approach was based on add of a filter action '''after_setup_theme''' to get user meta (here ''user_locale'') - this approach is not possible here in the function called by locale filter - ''purpose: changing live the dashboard language UI'' 8 10 9 11 {{{ … … 23 25 24 26 // to avoid notice with bbPress 2.3 - brutal approach 25 //if ( class_exists( 'bbPress') ) remove_action( 'set_current_user', 'bbp_setup_current_user' );26 //$locale = get_user_option( 'user_locale' );27 //if ( class_exists( 'bbPress') ) add_action( 'set_current_user', 'bbp_setup_current_user', 10 );27 if ( class_exists( 'bbPress') ) remove_action( 'set_current_user', 'bbp_setup_current_user' ); 28 $locale = get_user_option( 'user_locale' ); 29 if ( class_exists( 'bbPress') ) add_action( 'set_current_user', 'bbp_setup_current_user', 10 ); 28 30 29 // replace by30 $locale = $this->user_locale; // see after_setup_theme filter below31 // cannot be replaced here by (no operant in this filter 32 // $locale = $this->user_locale; // see after_setup_theme filter below 31 33 32 34 if ( empty( $locale ) ) … … 37 39 38 40 39 * from after_setup_theme action 41 * from after_setup_theme action - tested but not used after tests 40 42 * 41 43 * @since 2.8.8