Skip to:
Content

bbPress.org

Changes between Initial Version and Version 1 of Ticket #2309, comment 3


Ignore:
Timestamp:
04/24/2013 06:30:38 AM (8 years ago)
Author:
michelwppi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2309, comment 3

    initial v1  
    33Please find solution extracted from a class of a plugin setting live dashboard language (backside).
    44
     5'''Updated 2013-04-24 after a week tests:'''
     6
    57First "brutal" workaround was based on removing filter: see commented lines below
    68
    7 Second approach was based on add of a filter action '''after_setup_theme''' to get user meta (here ''user_locale'')
     9Second 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''
    810
    911{{{
     
    2325               
    2426                // 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 );
    2830               
    29                 // replace by
    30                 $locale = $this->user_locale; // see after_setup_theme filter below
     31                // cannot be replaced here by (no operant in this filter
     32                // $locale = $this->user_locale; // see after_setup_theme filter below
    3133               
    3234                if ( empty( $locale ) )
     
    3739
    3840
    39  * from after_setup_theme action
     41 * from after_setup_theme action - tested but not used after tests
    4042         *
    4143         * @since 2.8.8