WordPress.org

Plugin Directory

Changeset 1603364


Ignore:
Timestamp:
02/25/17 09:32:53 (9 months ago)
Author:
anmari
Message:

ver 4.4 with admin in front end translation load

Location:
amr-users/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • amr-users/trunk/amr-users.php

    r1597911 r1603364  
    66Description: Configurable users listings by meta keys and values, comment count and post count. Includes  display, inclusion, exclusion, sorting configuration and an option to export to CSV. If you found this useful, please <a href="http://wordpress.org/extend/plugins/amr-users/">  or rate it</a>, or write a post. 
    77Author: anmari 
    8 Version: 4.3 
     8Version: 4.4 
    99Text Domain: amr-users 
    1010Domain Path: /languages 
     
    5252        [headings]  (in html) 
    5353*/ 
    54 define ('AUSERS_VERSION', '4.3'); 
     54define ('AUSERS_VERSION', '4.4'); 
    5555define( 'AUSERS_URL', plugin_dir_url( __FILE__ ) ); 
    5656define ('AUSERS_DIR', plugin_dir_path( __FILE__ )  ); 
     
    102102     
    103103} 
    104 /*-------------------------------------------------------------- */ 
     104 
    105105function add_ameta_stylesheet () { 
    106106 
     
    114114      } 
    115115} 
    116 /*-------------------------------------------------------------- */ 
     116 
    117117function add_ameta_printstylesheet () { 
    118118      $myStyleUrl = AUSERS_URL.'css/alist_print.css'; 
     
    123123        } 
    124124} 
    125 /*-------------------------------------------------------------- */ 
     125 
    126126function amr_network_userlist($atts) { 
    127127global $ausers_do_network;   
     
    129129    return (amr_userlist($atts)); 
    130130} 
    131 /*-------------------------------------------------------------- */ 
     131  
    132132function amr_userlist($atts) { 
    133133global $ausers_do_network;   
     
    203203//      return('<!-- '.__('Inadequate permission for non public user list','amr-users').' -->'); 
    204204} 
    205 /*-------------------------------------------------------------- */ 
     205  
    206206function ausers_ok_to_show_list($list) { 
    207207global $amain; 
     
    215215 
    216216} 
    217 /*-------------------------------------------------------------- */ 
     217  
    218218function ausers_plugin_action($links, $file) { //   Adds a link directly to the settings page from the plugin page 
    219219    global $ausersadminurl; 
     
    224224    return $links; 
    225225    } // end plugin_action 
    226 /*------------------------------------------*/ 
     226  
    227227function amr_user_change ($userid='') { /* wordpress passes the user id as a argument on a "profile update action */ 
    228228global $amr_already_got_user_change; 
     
    234234    return (amr_request_cache()); 
    235235} 
    236 /*------------------------------------------*/ 
     236 
    237237function amr_user_meta_change ($metaid) { /* wordpress passes the user id as a argument on a "profile update action */ 
    238238global $amr_already_got_user_change; 
     
    244244    return (amr_request_cache()); 
    245245} 
    246 /*------------------------------------------*/ 
     246  
    247247function amr_request_cache_with_feedback ($list=null) { 
    248248global  $ausersadminurl; 
     
    270270// time()+3600 = one hour from now. 
    271271} 
    272 /*------------------------------------------*/ 
     272  
    273273function amr_request_cache ($list=null) { 
    274274    global $aopt; 
     
    337337// time()+3600 = one hour from now. 
    338338} 
    339 /*-------------------------------------------------------------- */ 
     339 
    340340function add_amr_script() { //* Enqueue style-file, if it exists. 
    341341 
     
    344344 
    345345} 
    346 /*-------------------------------------------------------------- */ 
     346  
    347347function add_amr_stylesheet() { 
    348348global $amain; 
     
    366366        } 
    367367    } 
    368 /*-------------------------------------------------------------- */ 
     368  
    369369function amr_users_widget_init() { 
    370370//    register_sidebar_widget("AmR iCal Widget", "amr_ical_list_widget"); 
     
    396396 
    397397    } 
    398 /*----------------------------------------------------------------------------------------*/ 
     398 
    399399function amr_users_deactivation () { 
    400400    global $amain; 
     
    408408    $c->deactivate(); 
    409409    } 
    410 /*----------------------------------------------------------------------------------------*/ 
     410  
    411411function amr_users_plus_updates_menu() { 
    412412//$parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function 
     
    424424    dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
    425425} 
    426 /*----------------------------------------------------------------------------------------*/ 
     426  
    427427    add_action('plugins_loaded'         , 'amr_users_load_text' ); 
    428428    //load_plugin_textdomain('amr-users', false, dirname(plugin_basename(__FILE__).'/languages/')); 
     
    458458    //add_filter( 'request',                    'amr_q_orderby' ); // - is affecting the posts query - must limit to users only! duh 
    459459 
    460     /*------------------------------------------------------------*/ 
     460 
    461461    /* When the plugin is activated, create the table if necessary */ 
    462462    register_activation_hook(__FILE__,      'ameta_cache_enable'); 
     
    467467    /* The deactivation hook is executed when the plugin is deactivated */ 
    468468    register_deactivation_hook(__FILE__,    'amr_users_deactivation'); 
    469     /*------------------------------------------------------------*/ 
    470469 
    471470 
  • amr-users/trunk/includes/ameta-building.php

    r1597911 r1603364  
    185185     
    186186    $args = apply_filters('amr-users-args',$args);  // 20150820 
     187     
     188    // wordpress does not load the admin translation file in the front end and so roles do not translate 
     189    if ( ! is_admin() ) { 
     190        $locale = get_locale();   
     191        if (!($locale === 'en_US')) {  
     192            if (amr_need_the_field($amr_current_list, 'first_role') or  
     193            amr_need_the_field($amr_current_list, 'roles')) {    
     194                load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' ); 
     195            } 
     196        } 
     197    } 
     198     
    187199 
    188200    if (isset($amain['use_wp_query']) and ($amain['use_wp_query'])) {   //check which kind  
  • amr-users/trunk/readme.txt

    r1597911 r1603364  
    44Tags: user, users, reports, lists, members, membership, authors, csv, export, search 
    55 
    6 Version: 4.3 
     6Version: 4.4 
    77 
    88Requires at least: 2.7  
     
    5050 
    5151== Changelog == 
     52= 4.4 = 
     53*  Fixed: Wordpress does not load admin text domain in front end. So if a website is not in English and a list includes roles, then the roles were not translated when the cache was refreshed in front end, but was in back end.  very confusing! 
     54Plugin will now load the wordpress admin text domain IF it is being run in the front end, IF the locale is not en_US and, if the first role or roles is required in the list. 
     55 
    5256= 4.3 = 
    5357*  Fixed: a recent fix broke alpha navigation querying.  Tricky to debug and still keep possibility to have alpha nav and grouping working at same time as possibly also displaying the fields being used. Various combinations of settings tested and I believe the combinations work now.  Thanks to klaus_hh for flagging this. 
Note: See TracChangeset for help on using the changeset viewer.