Changeset 3201795
- Timestamp:
- 12/03/2024 03:06:54 PM (13 months ago)
- Location:
- user-role-editor/trunk
- Files:
-
- 14 edited
-
changelog.txt (modified) (1 diff)
-
includes/classes/capabilities.php (modified) (1 diff)
-
includes/classes/capability.php (modified) (2 diffs)
-
includes/classes/editor.php (modified) (10 diffs)
-
includes/classes/grant-roles.php (modified) (4 diffs)
-
includes/classes/lib.php (modified) (1 diff)
-
includes/classes/role-view.php (modified) (5 diffs)
-
includes/classes/screen-help.php (modified) (4 diffs)
-
includes/classes/user-other-roles.php (modified) (1 diff)
-
includes/classes/user-role-editor.php (modified) (3 diffs)
-
includes/classes/user-view.php (modified) (3 diffs)
-
includes/classes/view.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
user-role-editor.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
user-role-editor/trunk/changelog.txt
r3037617 r3201795 1 1 CHANGES LOG (full version). 2 2 =========================== 3 4 = [4.64.3] 03.12.2024 = 5 * Update: Marked as compatible with WordPress 6.7.1 6 * Fix: PHP Notice: "Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the <code>user-role-editor</code> domain was triggered too early." was fixed (shown only for those who used own .mo translation file installed). 7 * Fix: Miscellaneous translation functionality (l18n) usage enhancements were applied. 3 8 4 9 = [4.64.2] 19.02.2024 = -
user-role-editor/trunk/includes/classes/capabilities.php
r2834853 r3201795 54 54 $cap = array(); 55 55 $cap['inner'] = $cap_id; 56 $cap['human'] = esc_html__( $this->convert_cap_to_readable( $cap_id ) , 'user-role-editor');56 $cap['human'] = $this->convert_cap_to_readable( $cap_id ); 57 57 if ( isset( $this->built_in_wp_caps[$cap_id] ) ) { 58 58 $cap['wp_core'] = true; -
user-role-editor/trunk/includes/classes/capability.php
r2834853 r3201795 108 108 $wp_roles->use_db = $use_db; 109 109 $response['result'] = 'success'; 110 // translators: placeholder %s is replaced by added user capability id string value 110 111 $response['message'] = sprintf( esc_html__( 'Capability %s was added successfully', 'user-role-editor' ), $cap_id ); 111 112 } else { 113 // translators: placeholder %s is replaced by existed user capability id string value 112 114 $response['message'] = sprintf( esc_html__( 'Capability %s exists already', 'user-role-editor' ), $cap_id ); 113 115 } … … 220 222 221 223 if ( count( $caps )==1 ) { 224 // translators: placeholder %s is replaced by removed user capability id string value 222 225 $mess = sprintf( esc_html__( 'Capability %s was removed successfully', 'user-role-editor' ), $caps[0] ); 223 226 } else { -
user-role-editor/trunk/includes/classes/editor.php
r2982954 r3201795 1029 1029 $wp_roles = wp_roles(); 1030 1030 if ( isset( $wp_roles->roles[$role_id] ) ) { 1031 $response['message'] = sprintf( 'Error! ' . esc_html__( 'Role %s exists already', 'user-role-editor' ), $role_id ); 1031 // translators: placeholder %s is replaced by existed user role id string value 1032 $response['message'] = 'Error! ' . sprintf( esc_html__( 'Role %s exists already', 'user-role-editor' ), $role_id ); 1032 1033 return $response; 1033 1034 } … … 1035 1036 $role_name = $this->lib->get_request_var( 'user_role_name', 'post' ); 1036 1037 if ( empty( $role_name ) ) { 1037 $role_name = $role_id; // as user role name is empty, use user role ID instead as a default value 1038 // as user role name is empty, use user role ID instead as a default value 1039 $role_name = $role_id; 1038 1040 } 1039 1041 $this->current_role = $role_id; … … 1043 1045 $capabilities = $this->remove_caps_not_allowed_for_single_admin( $role->capabilities ); 1044 1046 } else { 1045 $capabilities = array('read' => true, 'level_0' => true); // Use subscriber role permissions as a default value 1047 // Use subscriber role permissions as a default value 1048 $capabilities = array('read' => true, 'level_0' => true); 1046 1049 } 1047 1050 // add new role to the roles array … … 1055 1058 $response['role_id'] = $role_id; 1056 1059 $response['role_name'] = $role_name; 1057 $response['message'] = sprintf(esc_html__('Role %s is created successfully', 'user-role-editor'), $role_name ); 1060 // translators: placeholder %s is replaced by created user role id string value 1061 $response['message'] = sprintf( esc_html__('Role %s is created successfully', 'user-role-editor'), $role_name ); 1058 1062 1059 1063 … … 1147 1151 $wp_roles = wp_roles(); 1148 1152 if ( !isset( $wp_roles->roles[$role_id] ) ) { 1149 $response['message'] = sprintf('Error! ' . esc_html__('Role %s does not exists', 'user-role-editor'), $role_id); 1153 // translators: placeholder %s is replaced by not existed user role id string value 1154 $response['message'] = 'Error! '. sprintf( esc_html__('Role %s does not exists', 'user-role-editor'), $role_id ); 1150 1155 return $response; 1151 1156 } … … 1160 1165 1161 1166 $response['result'] = 'success'; 1162 $response['message'] = sprintf( esc_html__('Role %s is renamed to %s successfully', 'user-role-editor'), $old_role_name, $new_role_name ); 1167 // translators: 1st placeholder %s is replaced by original user role name, 2nd placehoder is replaced by new user role name 1168 $response['message'] = sprintf( esc_html__('Role %1$s is renamed to %2$s successfully', 'user-role-editor'), $old_role_name, $new_role_name ); 1163 1169 $response['role_id'] = $role_id; 1164 1170 $response['role_name'] = $new_role_name; … … 1294 1300 $response['message'] = esc_html__( 'Unused roles are deleted successfully', 'user-role-editor' ); 1295 1301 } else { 1302 // translators: placeholder %s is replaced by not deleted user role id string value 1296 1303 $response['message'] = sprintf( esc_html__( 'Role %s is deleted successfully', 'user-role-editor' ), $role_id ); 1297 1304 } … … 1338 1345 $this->wp_default_role = get_option( 'default_role' ); 1339 1346 if ($this->wp_default_role===$role_id) { 1340 $mess = sprintf(esc_html__('Default role for new users is set to %s successfully', 'user-role-editor'), $wp_roles->role_names[$role_id]); 1347 // translators: placeholder %s is replaced by default user role name 1348 $mess = sprintf( esc_html__('Default role for new users is set to %s successfully', 'user-role-editor'), $wp_roles->role_names[$role_id] ); 1341 1349 } else { 1342 1350 $mess = 'Error! ' . esc_html__('Error encountered during default role change operation', 'user-role-editor'); … … 1345 1353 $mess = 'Error! ' . esc_html__('Can not set Administrator role as a default one', 'user-role-editor'); 1346 1354 } else { 1347 $mess = 'Error! ' . esc_html__('This role does not exist - ', 'user-role-editor') . esc_html( $role_id);1355 $mess = 'Error! ' . esc_html__('This role does not exist - ', 'user-role-editor') . esc_html( $role_id ); 1348 1356 } 1349 1357 … … 1480 1488 ?> 1481 1489 <div class="wrap"> 1482 <h1><?php _e('User Role Editor', 'user-role-editor'); ?></h1>1490 <h1><?php esc_html_e('User Role Editor', 'user-role-editor'); ?></h1> 1483 1491 <div id="ure_container"> 1484 1492 <div id="user_role_editor" class="ure-table-cell" > -
user-role-editor/trunk/includes/classes/grant-roles.php
r3037617 r3201795 376 376 ?> 377 377 <span style="font-weight: bold;"> 378 <?php esc_html_e('Primary Role: ', ' role-editor');?>378 <?php esc_html_e('Primary Role: ', 'user-role-editor');?> 379 379 </span> 380 380 <select name="primary_role" id="primary_role"> … … 382 382 // print the full list of roles with the primary one selected. 383 383 wp_dropdown_roles(''); 384 echo '<option value="'. self::NO_ROLE_FOR_THIS_SITE .'">' . esc_html__('— No role for this site —' ) . '</option>'. PHP_EOL;384 echo '<option value="'. self::NO_ROLE_FOR_THIS_SITE .'">' . esc_html__('— No role for this site —', 'user-role-editor') . '</option>'. PHP_EOL; 385 385 ?> 386 386 </select> … … 396 396 <span style="font-weight: bold;"> 397 397 <?php 398 esc_html_e('Other Roles: ', ' role-editor');398 esc_html_e('Other Roles: ', 'user-role-editor'); 399 399 ?> 400 400 </span><br> 401 401 <?php 402 // Is PolyLang plugin active? 403 $use_pll = function_exists('pll__'); 404 402 405 $show_admin_role = $this->lib->show_admin_role_allowed(); 403 406 $roles = $this->lib->get_all_editable_roles(); … … 406 409 continue; 407 410 } 411 $role_name = $use_pll ? pll__( $role['name'] ) : $role['name']; 408 412 echo '<label for="wp_role_' . $role_id . '"><input type="checkbox" id="wp_role_' . $role_id . 409 413 '" name="ure_roles[]" value="' . $role_id . '" /> ' . 410 esc_html __($role['name'], 'user-role-editor') .' ('. $role_id .')</label><br />'. PHP_EOL;414 esc_html( $role_name ) .' ('. $role_id .')</label><br />'. PHP_EOL; 411 415 } 412 416 ?> -
user-role-editor/trunk/includes/classes/lib.php
r3037617 r3201795 387 387 388 388 <strong><?php esc_html_e('Version:', 'user-role-editor');?></strong> <?php echo URE_VERSION; ?><br/><br/> 389 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/vladimir.png'; ?>);" target="_blank" href="http://www.shinephp.com/"><?php _e("Author's website", 'user-role-editor'); ?></a><br/> 390 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com"><?php _e('Plugin webpage', 'user-role-editor'); ?></a><br/> 391 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/download-plugin"><?php _e('Plugin download', 'user-role-editor'); ?></a><br/> 392 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/changelog-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/changelog"><?php _e('Changelog', 'user-role-editor'); ?></a><br/> 393 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/faq-icon.png'; ?>);" target="_blank" href="http://www.shinephp.com/user-role-editor-wordpress-plugin/#faq"><?php _e('FAQ', 'user-role-editor'); ?></a><br/> 394 <?php 395 /* 396 <hr /> 397 <div style="text-align: center;"> 398 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 399 <input type="hidden" name="cmd" value="_s-xclick"> 400 <input type="hidden" name="encrypted" 401 value="-----BEGIN PKCS7-----MIIHZwYJKoZIhvcNAQcEoIIHWDCCB1QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbi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ODU3MjdaMCMGCSqGSIb3DQEJBDEWBBSFh6YmkoVtYdMaDd5G6EN0dGcPpzANBgkqhkiG9w0BAQEFAASBgAB91K/+gsmpbKxILdCVXCkiOg1zSG+tfq2EZSNzf8z/R1E3HH8qPdm68OToILsgWohKFwE+RCwcQ0iq77wd0alnWoknvhBBoFC/U0yJ3XmA3Hkgrcu6yhVijY/Odmf6WWcz79/uLGkvBSECbjTY0GLxvhRlsh2nAioCfxAr1cFo-----END PKCS7-----"> 402 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 403 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 404 </form> 405 </div> 406 */ 407 ?> 408 389 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/vladimir.png'; ?>);" target="_blank" href="http://www.shinephp.com/"><?php esc_html_e("Author's website", 'user-role-editor'); ?></a><br/> 390 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com"><?php esc_html_e('Plugin webpage', 'user-role-editor'); ?></a><br/> 391 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/download-plugin"><?php esc_html_e('Plugin download', 'user-role-editor'); ?></a><br/> 392 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/changelog-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/changelog"><?php esc_html_e('Changelog', 'user-role-editor'); ?></a><br/> 393 <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/faq-icon.png'; ?>);" target="_blank" href="http://www.shinephp.com/user-role-editor-wordpress-plugin/#faq"><?php esc_html_e('FAQ', 'user-role-editor'); ?></a><br/> 409 394 <?php 410 395 } -
user-role-editor/trunk/includes/classes/role-view.php
r2982954 r3201795 6 6 * @subpackage Admin 7 7 * @author Vladimir Garagulya <[email protected]> 8 * @copyright Copyright (c) 2010 - 20 16, Vladimir Garagulya8 * @copyright Copyright (c) 2010 - 2024, Vladimir Garagulya 9 9 **/ 10 10 class URE_Role_View extends URE_View { … … 45 45 $disabled = ($key==='administrator' && $caps_access_restrict_for_simple_admin && !$this->lib->is_super_admin()) ? 'disabled' : ''; 46 46 if ($show_admin_role || $key != 'administrator') { 47 $this->role_default_html .= '<option value="' . $key . '" ' . $selected .' '. $disabled .'>'. $value['name'].' (' . $key . ')</option>';47 $this->role_default_html .= '<option value="' . $key . '" ' . $selected .' '. $disabled .'>'. esc_html( $value['name'] ) .' (' . $key . ')</option>'; 48 48 } 49 49 } … … 76 76 $disabled = ( $key==='administrator' && $caps_access_restrict_for_simple_admin && !$this->lib->is_super_admin()) ? 'disabled' : ''; 77 77 if ( $show_admin_role || $key != 'administrator' ) { 78 $role_name = $value['name'].' (' . $key . ')';78 $role_name = esc_html( $value['name'] ) .' (' . $key . ')'; 79 79 $this->role_select_html .= '<option value="' . $key . '" ' . $selected1 .' '. $disabled .'>' . $role_name . '</option>'; 80 80 $this->role_to_copy_html .= '<option value="' . $key .'" '. $disabled .'>' . $role_name . '</option>'; … … 94 94 $this->role_delete_html = '<select id="del_user_role" name="del_user_role" width="250" style="width: 250px">'; 95 95 foreach ($roles_can_delete as $key => $value) { 96 $this->role_delete_html .= '<option value="' . $key . '">' . esc_html __($value, 'user-role-editor') . '</option>';96 $this->role_delete_html .= '<option value="' . $key . '">' . esc_html( $value ) . '</option>'; 97 97 } 98 98 $this->role_delete_html .= '<option value="-1" style="color: red;">' . esc_html__('Delete All Unused Roles', 'user-role-editor') . '</option>'; … … 367 367 } 368 368 if ($multisite && $active_for_network && !is_network_admin() && is_main_site(get_current_blog_id()) && $this->lib->is_super_admin()) { 369 $hint = esc_html__( 'If checked, then apply action to ALL sites of this Network');369 $hint = esc_html__( 'If checked, then apply action to ALL sites of this Network', 'user-role-editor' ); 370 370 $apply_to_all = $this->editor->get('apply_to_all'); 371 371 if ($apply_to_all) { -
user-role-editor/trunk/includes/classes/screen-help.php
r2265379 r3201795 13 13 <p> 14 14 <ul> 15 <li><strong>' . esc_html__('Show Administrator role at User Role Editor', 'user-role-editor') .'</strong> - ' .16 esc_html__('turn this option on in order to make the "Administrator" role available at the User Role Editor '17 . 'roles selection drop-down list.It is hidden by default for security reasons.','user-role-editor') . '</li>15 <li><strong>' . esc_html__('Show Administrator role at User Role Editor', 'user-role-editor') .'</strong> - ' . 16 esc_html__('turn this option on in order to make the "Administrator" role available at the User Role Editor roles selection drop-down list.', 'user-role-editor') .' '. 17 esc_html__('It is hidden by default for security reasons.','user-role-editor') . '</li> 18 18 <li><strong>' . esc_html__('Show capabilities in the human readable form','user-role-editor').'</strong> - ' . 19 esc_html__('automatically converts capability names from the technical form for internal use like ' 20 . '"edit_others_posts" to more user friendly form, e.g. "Edit others posts".','user-role-editor') . '</li> 21 <li><strong>' . esc_html__('Show deprecated capabilities','user-role-editor').'</strong> - '. 22 esc_html__('Capabilities like "level_0", "level_1" are deprecated and are not used by WordPress. ' 23 . 'They are left at the user roles for the compatibility purpose with old themes and plugins code. ' 24 . 'Turning on this option will show those deprecated capabilities.', 'user-role-editor') . '</li> 19 esc_html__('automatically converts capability names from the technical form for internal use like "edit_others_posts" to more user friendly form, e.g. "Edit others posts".','user-role-editor') . '</li> 20 <li><strong>' . esc_html__('Show deprecated capabilities','user-role-editor') .'</strong> - '. 21 esc_html__('Capabilities like "level_0", "level_1" are deprecated and are not used by WordPress.','user-role-editor') .' '. 22 esc_html__('They are left at the user roles for the compatibility purpose with old themes and plugins code.','user-role-editor') .' '. 23 esc_html__('Turning on this option will show those deprecated capabilities.', 'user-role-editor') . '</li> 25 24 <li><strong>' . esc_html__('Confirm role update','user-role-editor').'</strong> - ' . 26 esc_html__('Show confirmation dialog before save changes made to a current role.' ) . '</li>27 <li><strong>' . esc_html__('Edit user capabilities','user-role-editor') .'</strong> - '.28 esc_html__('If turned off - capabilities section of selected user is shown in readonly mode. '29 . 'Administrator can not assign capabilities to the user directly. '30 .'He should do it using roles only.', 'user-role-editor') . '</li>';25 esc_html__('Show confirmation dialog before save changes made to a current role.', 'user-role-editor') . '</li> 26 <li><strong>' . esc_html__('Edit user capabilities','user-role-editor') .'</strong> - '. 27 esc_html__('If turned off - capabilities section of selected user is shown in readonly mode.','user-role-editor'). ' '. 28 esc_html__('Administrator can not assign capabilities to the user directly.','user-role-editor'). ' '. 29 esc_html__('He should do it using roles only.', 'user-role-editor') . '</li>'; 31 30 32 31 $text = apply_filters('ure_get_settings_general_tab_help', $text); … … 45 44 <ul>'; 46 45 if (!is_multisite()) { 47 $text .= '<li><strong>' . esc_html__('Count users without role', 'user-role-editor').'</strong> - ' . 48 esc_html__('Show at the "Users" page a quant of users without role. Module allows to assign all of them '. 49 'an empty role "No rights", in order to look on the users list with role "No rights" at the separate tab then.','user-role-editor') . '</li>'; 46 $text .= '<li><strong>' . esc_html__('Count users without role', 'user-role-editor') .'</strong> - ' . 47 esc_html__('Show at the "Users" page a quant of users without role. Module allows to assign all of them ', 'user-role-editor') .' '. 48 esc_html__('an empty role "No rights", in order to look on the users list with role "No rights" at the separate tab then.','user-role-editor') . 49 '</li>'; 50 50 } 51 51 $text = apply_filters('ure_get_settings_additional_modules_tab_help', $text); … … 63 63 <p> 64 64 <ul> 65 <li><strong>' . esc_html__('Other default roles for new registered user', 'user-role-editor') .'</strong> - ' .66 esc_html__('select roles below to assign them to the new user automatically as an addition to the primary role. '.67 'Note for multisite environment: take into account that other default roles should exist at the site,'.68 'in order to be assigned to the new registered users.','user-role-editor') . '</li>';65 <li><strong>' . esc_html__('Other default roles for new registered user', 'user-role-editor') .'</strong> - ' . 66 esc_html__('select roles below to assign them to the new user automatically as an addition to the primary role.', 'user-role-editor') .' '. 67 esc_html__('Note for multisite environment: take into account that other default roles should exist at the site,', 'user-role-editor') .' '. 68 esc_html__('in order to be assigned to the new registered users.','user-role-editor') . '</li>'; 69 69 70 70 $text = apply_filters('ure_get_settings_default_roles_tab_help', $text); … … 82 82 <p> 83 83 <ul> 84 <li><strong>' . esc_html__( 'Allow non super-administrators to create, edit and delete users', 'user-role-editor' ) .'</strong> - '.85 esc_html__( 'Super administrator only may create, edit and delete users under WordPress multi-site by default. '.86 'Turn this option on in order to remove this limitation.','user-role-editor' ) .'</li>';84 <li><strong>' . esc_html__( 'Allow non super-administrators to create, edit and delete users', 'user-role-editor' ) .'</strong> - '. 85 esc_html__( 'Super administrator only may create, edit and delete users under WordPress multi-site by default.', 'user-role-editor' ) .' '. 86 esc_html__('Turn this option on in order to remove this limitation.','user-role-editor' ) .'</li>'; 87 87 88 88 $text = apply_filters('ure_get_settings_multisite_tab_help', $text); 89 89 $text .=' 90 90 </ul> 91 </p>';91 </p>'; 92 92 93 93 return $text; -
user-role-editor/trunk/includes/classes/user-other-roles.php
r3037617 r3201795 216 216 $output = ''; 217 217 foreach ($user->caps as $cap => $value) { 218 if (!$wp_roles->is_role($cap)) { 219 if ('' != $output) { 220 $output .= ', '; 221 } 222 $output .= $value ? $cap : sprintf(__('Denied: %s'), $cap); 223 } 218 if ( $wp_roles->is_role( $cap ) ) { 219 continue; 220 } 221 if ('' !== $output) { 222 $output .= ', '; 223 } 224 // translators: placeholder %s is replaced by denied user capability id string value 225 $output .= $value ? $cap : sprintf(__('Denied: %s', 'user-role-editor'), $cap); 224 226 } 225 227 -
user-role-editor/trunk/includes/classes/user-role-editor.php
r3037617 r3201795 117 117 118 118 add_action( 'admin_init', array($this, 'plugin_init'), 1 ); 119 120 // Add the translation function after the plugins loaded hook. 121 add_action('plugins_loaded', array($this, 'load_translation')); 119 add_action('init', array($this, 'load_translation')); 122 120 123 121 // add own submenu … … 482 480 483 481 /** 484 * Load plugin translation files - linked to the ' plugins_loaded' action482 * Load plugin translation files - linked to the 'init' action 485 483 * 486 484 */ … … 945 943 * 946 944 */ 947 function translate_custom_roles( $roles ) { 948 945 function translate_custom_roles( $roles ) { 946 947 $use_pll = function_exists('pll__'); 948 949 949 foreach ($roles as $key => $value) { 950 $ translated_name = esc_html__( $value['name'], 'user-role-editor' ); // get translation from URE language file, if exists951 if ( $translated_name === $value['name'] ) {952 if ( $this->lib->is_wp_built_in_role( $key ) ) {953 // get WordPress internal translation954 $translated_name = translate_user_role( $translated_name );955 } elseif ( function_exists('pll_register_string') ) {956 // Integration with PolyLang plugin (https://wordpress.org/plugins/polylang/)957 $translated_name = pll__( $translated_name );958 }950 $role_name = $value['name']; 951 if ($this->lib->is_wp_built_in_role($key)) { 952 // get WordPress internal translation 953 $translated_name = translate_user_role( $role_name ); 954 } elseif ($use_pll) { 955 // Integration with PolyLang plugin (https://wordpress.org/plugins/polylang/) 956 $translated_name = pll__($role_name); 957 } else { // translation is not available 958 $translated_name = $role_name; 959 959 } 960 $roles[$key]['name'] = $translated_name;961 } 962 960 $roles[$key]['name'] = esc_html( $translated_name ); 961 } 962 963 963 $roles = apply_filters('ure_editable_roles', $roles ); 964 964 965 965 return $roles; 966 } 966 } 967 967 // end of translate_custom_roles() 968 968 -
user-role-editor/trunk/includes/classes/user-view.php
r2949187 r3201795 57 57 if (class_exists('user_switching') && current_user_can('switch_to_user', $this->user_to_edit->ID)) { 58 58 $switch_to_user_link = user_switching::switch_to_url($this->user_to_edit); 59 $switch_to_user = '<a href="' . esc_url($switch_to_user_link) . '">' . esc_html__('Switch To', 'user- switching') . '</a>';59 $switch_to_user = '<a href="' . esc_url($switch_to_user_link) . '">' . esc_html__('Switch To', 'user-role-editor') . '</a>'; 60 60 } 61 61 } else { … … 94 94 // print the 'no role' option. Make it selected if the user has no role yet. 95 95 $selected = ( empty($user_primary_role) ) ? 'selected="selected"' : ''; 96 echo '<option value="" '. $selected.'>' . esc_html__('— No role for this site —' ) . '</option>';96 echo '<option value="" '. $selected.'>' . esc_html__('— No role for this site —', 'user-role-editor') . '</option>'; 97 97 ?> 98 98 </select> … … 106 106 $values = array_values($this->user_to_edit->roles); 107 107 $primary_role = array_shift($values); // get 1st element from roles array 108 109 // Is PolyLang plugin active? 110 $use_pll = function_exists('pll__'); 111 108 112 $roles = $this->editor->get('roles'); 109 113 foreach ($roles as $role_id => $role) { 110 114 if (($show_admin_role || $role_id != 'administrator') && ($role_id !== $primary_role)) { 111 if ( $this->editor->user_can($role_id)) {115 if ( $this->editor->user_can( $role_id ) ) { 112 116 $checked = 'checked="checked"'; 113 117 } else { 114 118 $checked = ''; 115 119 } 120 $role_name = $use_pll ? pll__( $role['name'] ) : $role['name']; 116 121 echo '<label for="wp_role_' . $role_id . '"><input type="checkbox" id="wp_role_' . $role_id . 117 122 '" name="wp_role_' . $role_id . '" value="' . $role_id . '"' . $checked . ' /> ' . 118 esc_html __($role['name'], 'user-role-editor') . '</label><br />';123 esc_html( $role_name ) . '</label><br />'; 119 124 } 120 125 } -
user-role-editor/trunk/includes/classes/view.php
r2949187 r3201795 207 207 $cap_ind_alt = 'human'; 208 208 } 209 $cap_html .= '<label for="' . $cap_id_esc . '" id="' . $cap_id_esc . '_label" title="' . $capability[$cap_ind_alt]. '" ' . $label_style . ' >'.210 $capability[$cap_ind]. '</label> </div>';209 $cap_html .= '<label for="' . $cap_id_esc . '" id="' . $cap_id_esc . '_label" title="' . esc_html( $capability[$cap_ind_alt] ) . '" ' . $label_style . ' >'. 210 esc_html( $capability[$cap_ind] ) . '</label> </div>'; 211 211 212 212 $output .= $cap_html; -
user-role-editor/trunk/readme.txt
r3186827 r3201795 3 3 Tags: user, role, editor, security, access 4 4 Requires at least: 4.4 5 Tested up to: 6.7 5 Tested up to: 6.7.1 6 6 Stable tag: 4.64.2 7 7 Requires PHP: 7.3 … … 83 83 == Changelog = 84 84 85 = [4.64.3] 03.12.2024 = 86 * Update: Marked as compatible with WordPress 6.7.1 87 * Fix: PHP Notice: "Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the <code>user-role-editor</code> domain was triggered too early." was fixed (shown only for those who used own .mo translation file installed). 88 * Fix: Miscellaneous translation functionality (l18n) usage enhancements were applied. 89 85 90 = [4.64.2] 19.02.2024 = 86 91 * Update: Marked as compatible with WordPress 6.4.3 -
user-role-editor/trunk/user-role-editor.php
r3037617 r3201795 4 4 Plugin URI: https://www.role-editor.com 5 5 Description: Change/add/delete WordPress user roles and capabilities. 6 Version: 4.64. 26 Version: 4.64.3 7 7 Author: Vladimir Garagulya 8 8 Author URI: https://www.role-editor.com … … 30 30 } 31 31 32 define( 'URE_VERSION', '4.64. 2' );32 define( 'URE_VERSION', '4.64.3' ); 33 33 define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 34 34 define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.