Changeset 2936394
- Timestamp:
- 07/10/2023 08:14:45 AM (3 years ago)
- Location:
- gleap/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (2 diffs)
-
admin/class-gleap-admin.php (modified) (2 diffs)
-
gleap.php (modified) (2 diffs)
-
public/class-gleap-public.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
gleap/trunk/README.txt
r2894111 r2936394 3 3 Tags: bug-tracking, bug-reporting, user-feedback, support, feedback, customer-feedback, live-chat, chat 4 4 Requires at least: 4.1.5 5 Tested up to: 6.2. 06 Stable tag: 9.0.05 Tested up to: 6.2.2 6 Stable tag: 11.0.0 7 7 License: Commercial 8 8 License URI: https://github.com/Gleap/Wordpress/blob/main/README.txt … … 39 39 == Changelog == 40 40 41 = 9.0.0 =42 * Updated to Gleap Widget 9.0.041 = 11.0.0 = 42 * Added permission based widget toggle. 43 43 44 44 = 8.0.5 = -
gleap/trunk/admin/class-gleap-admin.php
r2813372 r2936394 121 121 public function setup_settings_ui() 122 122 { 123 // Get WordPress roles 124 $wp_roles = wp_roles(); 125 $roles = array(); 126 foreach($wp_roles->roles as $role => $details){ 127 $roles[$role] = translate_user_role($details['name']); 128 } 129 123 130 Container::make('theme_options', __('Gleap')) 124 131 ->set_page_parent('options-general.php') … … 130 137 )) 131 138 ->add_fields(array( 132 Field::make('checkbox', 'gleap_editors_only', 'Enable just for logged in editors')->set_default_value(false)->set_help_text('Widget will only be visible for users with editor or higher role.') 139 Field::make('checkbox', 'gleap_selected_roles_only', 'Enable Gleap only for the selected WP roles') 140 ->set_default_value(false) 141 ->set_help_text('Gleap widget will only be visible for users with the selected roles. If no roles are selected, it will be visible to all users.') 142 )) 143 ->add_fields(array( 144 Field::make('multiselect', 'gleap_selected_roles', 'Select roles') 145 ->add_options($roles) 146 ->set_conditional_logic(array( 147 array( 148 'field' => 'gleap_selected_roles_only', 149 'value' => true, 150 'compare' => '=' 151 ) 152 )) 133 153 )); 134 154 } 135 155 136 156 public function crb_load() 137 157 { -
gleap/trunk/gleap.php
r2894111 r2936394 17 17 * Plugin Name: Gleap 18 18 * Description: Gleap helps developers build the best software faster. It is your affordable in-app bug reporting tool for apps, websites and industrial applications. 19 * Version: 9.0.019 * Version: 11.0.0 20 20 * Author: Gleap 21 21 * Author URI: https://www.gleap.io … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'GLEAP_VERSION', ' 9.0.0' );38 define( 'GLEAP_VERSION', '11.0.0' ); 39 39 40 40 /** -
gleap/trunk/public/class-gleap-public.php
r2894111 r2936394 94 94 $gleap_token = carbon_get_theme_option('gleap_token'); 95 95 if ($gleap_token) { 96 $gleap_editors_only = carbon_get_theme_option('gleap_editors_only'); 97 if ($gleap_editors_only == true && !current_user_can('report_feedback')) { 98 return; 96 $gleap_selected_roles_only = carbon_get_theme_option('gleap_selected_roles_only'); 97 if ($gleap_selected_roles_only == true) { 98 $user_roles = wp_get_current_user()->roles; 99 $gleap_selected_roles = carbon_get_theme_option('gleap_selected_roles'); 100 101 if (!array_intersect($user_roles, $gleap_selected_roles)) { 102 // If the user's role is not in the selected roles, don't show Gleap 103 return; 104 } 99 105 } 100 106 101 107 $identify_script = ""; 102 108 $gleap_identity_token = carbon_get_theme_option('gleap_identity_token'); 103 if (is_user_logged_in() && $gleap_identity_token) {109 if (is_user_logged_in()) { 104 110 $user_data = get_userdata(get_current_user_id()); 105 111 $login = $user_data->user_login;
Note: See TracChangeset
for help on using the changeset viewer.