[import-users]
[import-users role="editor"]
[import-users role="editor" delete-only-specified-role="true"]

select( array( 'options' => ACUI_Helper::get_editable_roles(), 'name' => 'role-frontend', 'selected' => $role, 'show_option_all' => false, 'show_option_none' => __( 'Disable role assignment in frontend import', 'import-users-from-csv-with-meta' ), )); ?>

checkbox( array( 'name' => 'send-mail-frontend', 'label' => __( 'Do you wish to send an email with credentials and other data?', 'import-users-from-csv-with-meta' ), 'compare_value' => $send_mail_frontend ) ); ?>

checkbox( array( 'name' => 'send-mail-updated-frontend', 'label' => __( 'Do you wish to send this mail also to users that are being updated? (not just to the one which are being created)', 'import-users-from-csv-with-meta' ), 'compare_value' => $send_mail_updated_frontend ) ); ?>

checkbox( array( 'name' => 'force_user_reset_password', 'compare_value' => get_option( 'acui_frontend_force_user_reset_password' ) ) ); ?>

checkbox( array( 'name' => 'send_mail_admin_frontend', 'compare_value' => $send_mail_admin_frontend ) ); ?>
text( array( 'name' => 'send_mail_admin_frontend_address_list', 'value' => $send_mail_admin_adress_list_frontend, 'class' => '', 'placeholder' => __( 'Include a list of emails where notification will be sent, use commas to separate addresses', 'import-users-from-csv-with-meta' ) ) ); ?>

select( array( 'options' => array( 'no' => __( 'No', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Yes', 'import-users-from-csv-with-meta' ) ), 'name' => 'update_existing_users', 'selected' => $update_existing_users, 'show_option_all' => false, 'show_option_none' => false, )); ?>
select( array( 'options' => array( 'no' => __( 'No', 'import-users-from-csv-with-meta' ), 'yes_no_override' => __( 'Yes, add new roles and do not override existing ones', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Yes', 'import-users-from-csv-with-meta' ) ), 'name' => 'update_roles_existing_users', 'selected' => $update_roles_existing_users, 'show_option_all' => false, 'show_option_none' => false, )); ?>

checkbox( array( 'name' => 'delete_users_frontend', 'compare_value' => $delete_users_frontend ) ); ?>
select( array( 'options' => ACUI_Helper::get_list_users_with_display_name(), 'name' => 'delete-users-assign-posts-frontend', 'selected' => $delete_users_assign_posts_frontend, 'show_option_all' => false, 'show_option_none' => __( 'Delete posts of deleted users without assigning to any user', 'import-users-from-csv-with-meta' ), )); ?>

checkbox( array( 'name' => 'change_role_not_present_frontend', 'compare_value' => $change_role_not_present_frontend ) ); ?>
select( array( 'options' => ACUI_Helper::get_editable_roles(), 'name' => 'change_role_not_present_role_frontend', 'selected' => $change_role_not_present_role_frontend, 'show_option_all' => false, 'show_option_none' => false, )); ?>

[export-users]
[export-users role="editor"]
[export-users columns="user_email,first_name,last_name"]

:
user_email=>Email,first_name=>First name,last_name=>Last name
[export-users from=""]
[export-users to=""]
COMMA, COLON, SEMICOLON, TAB
[export-users delimiter="SEMICOLON"]
[export-users order_fields_alphabetically="yes"]
[export-users double_encapsulate_serialized_values="yes"]
[export-users display_arrays_as_comma_separated_list_of_values="yes"]
  • ID:
  • display_name:
  • name or user_name:
  • login or user_login:
  • nicename or user_nicename:
  • email or user_email:
  • url or user_url:
  • registered or user_registered:
  • post_count:
  • :
[export-users orderby="user_email"]
[export-users orderby="display_name" order="asc"]

user_login; $body_mail = sprintf( __("User with username: %s has executed an import using the shortcode in the frontend.", 'import-users-from-csv-with-meta'), $current_user_name ); wp_mail( $send_mail_admin_adress_list_frontend, '[Import and export users and customers] Frontend import has been executed', $body_mail, array( 'Content-Type: text/html; charset=UTF-8' ) ); } function shortcode_import( $atts ) { $atts = shortcode_atts( array( 'role' => '', 'delete-only-specified-role' => false ), $atts ); ob_start(); if( !current_user_can( apply_filters( 'acui_capability', 'create_users' ) ) ) wp_die( __( 'Only users who are allowed to create users can manage this form.', 'import-users-from-csv-with-meta' ) ); if ( $_FILES && !empty( $_POST ) ): if ( !wp_verify_nonce( $_POST['security'], 'codection-security' ) ){ wp_die( __( 'Nonce check failed', 'import-users-from-csv-with-meta' ) ); } if( $_FILES['uploadfile']['error'] != 0 || $_FILES['uploadfile']['size'] == 0 ){ _e( 'You must choose a file', 'import-users-from-csv-with-meta' ); } else{ do_action( 'acui_pre_frontend_import' ); // start $form_data = array(); $form_data["path_to_file"] = sanitize_text_field( $_FILES['uploadfile']['tmp_name'] ); // emails $form_data["sends_email"] = get_option( "acui_frontend_send_mail" ); $form_data["send_email_updated"] = get_option( "acui_frontend_send_mail_updated" ); $form_data["force_user_reset_password"] = get_option( "acui_frontend_force_user_reset_password" ); // roles $form_data["role"] = empty( $atts["role"] ) ? get_option( "acui_frontend_role") : $atts["role"]; // update $form_data["update_existing_users"] = empty( get_option( "acui_frontend_update_existing_users" ) ) ? 'no' : get_option( "acui_frontend_update_existing_users" ); $form_data["update_roles_existing_users"] = empty( get_option( "acui_frontend_update_roles_existing_users" ) ) ? 'no' : get_option( "acui_frontend_update_roles_existing_users" ); // delete $form_data["delete_users_not_present"] = ( get_option( "acui_frontend_delete_users" ) ) ? 'yes' : 'no'; $form_data["delete_users_assign_posts"] = get_option( "acui_frontend_delete_users_assign_posts" ); $form_data["delete_users_only_specified_role"] = empty( $form_data[ "role" ] ) ? false : $atts['delete-only-specified-role']; // others $form_data["empty_cell_action"] = "leave"; $form_data["activate_users_wp_members"] = empty( get_option( "acui_frontend_activate_users_wp_members" ) ) ? 'no_activate' : get_option( "acui_frontend_activate_users_wp_members" ); $form_data["security"] = wp_create_nonce( "codection-security" ); $form_data = apply_filters( 'acui_frontend_import_form_data', $form_data ); $acui_import = new ACUI_Import(); $acui_import->fileupload_process( $form_data, false, true ); do_action( 'acui_post_frontend_import' ); } else: ?>
'', 'from' => '', 'to' => '', 'delimiter' => '', 'order_fields_alphabetically' => '', 'double_encapsulate_serialized_values' => '', 'display_arrays_as_comma_separated_list_of_values' => '', 'columns' => '', 'orderby' => '', 'order' => '' ), $atts ); if( isset( $atts['role'] ) ){ $atts['role[]'] = $atts['role']; unset( $atts['role'] ); } wp_enqueue_script( 'jquery' ); ob_start(); if( !current_user_can( apply_filters( 'acui_capability', 'create_users' ) ) ) wp_die( __( 'Only users who are allowed to create users can export them.', 'import-users-from-csv-with-meta' ) ); ACUI_Exporter::enqueue(); ACUI_Exporter::styles(); ?>
$value ): ?>
0%
hooks();