PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.4
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.4
6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 All 35 releases
← All changes | integrations/wordpress/actions/create-user.php +10 -3 6.0.2 → 6.0.4 View file →
@@ -170,16 +170,23 @@
170 170
171 171 // Check the user role
172 172 $roles = automatorwp_get_editable_roles();
173 173
174 - if( ! isset( $roles[$user_data['role']] ) ) {
174 + if( ! isset( $roles[$user_data['role']] ) )
175 175 $user_data['role'] = 'subscriber';
176 +
177 + // Check if role comes from role_custom (which could come from a tag)
178 + if( $action_options['role_custom'] === 'administrator' ) {
179 + // Security filter to allows through code create administrator users if not desired
180 + $allow_admin = apply_filters( 'automatorwp_allow_create_admin_user_from_custom_role', false, $action, $user_id, $action_options, $automation );
181 +
182 + if( ! $allow_admin )
183 + $user_data['role'] = 'subscriber';
176 184 }
177 185
178 186 // Generate the user password
179 - if( empty( $user_data['user_pass'] ) ) {
187 + if( empty( $user_data['user_pass'] ) )
180 188 $user_data['user_pass'] = wp_generate_password( 24 );
181 - }
182 189
183 190 // Insert the user
184 191 $this->user_id = wp_insert_user( $user_data );
185 192