maybe_migrate_old_options( 'import_backend' ); $upload_dir = wp_upload_dir(); $sample_path = $upload_dir["path"] . '/test.csv'; $sample_url = plugin_dir_url( dirname( __FILE__ ) ) . 'test.csv'; if( is_int( $settings->get( 'delete_users_assign_posts' ) ) ){ $delete_users_assign_posts_user = get_user_by( 'id', $settings->get( 'delete_users_assign_posts' ) ); $delete_users_assign_posts_options = array( $settings->get( 'delete_users_assign_posts' ) => $delete_users_assign_posts_user->display_name ); $delete_users_assign_posts_option_selected = $settings->get( 'delete_users_assign_posts' ); } else{ $delete_users_assign_posts_options = array( 0 => __( 'No user selected', 'import-users-from-csv-with-meta' ) ); $delete_users_assign_posts_option_selected = 0; } ?>
2 columns: username and email. These should be the first two columns and it should be placed in this order: username and email. Both data are required unless you use this addon to allow empty emails. If there are more columns, this plugin will manage it automatically.', 'import-users-from-csv-with-meta' ), 'https://import-wp.com/allow-no-email-addon/' ); ?>
passwords are managed and also take note about capitalization, this plugin is case sensitive.', 'import-users-from-csv-with-meta' ); ?>

', 'import-users-from-csv-with-meta' ); ?>
or you can choose directly a file from your host or from an external URL', 'import-users-from-csv-with-meta' ) ?> .

$value ) ACUIHTML()->checkbox( array( 'label' => translate_user_role( $value ), 'name' => 'role[]', 'compare_value' => $settings->get( 'role' ), 'current' => $key, 'array' => true, 'class' => 'roles' ) ); ?>

Profile Builder - Roles Editor to manage them. Click to Install & Activate', esc_url( wp_nonce_url( self_admin_url('update.php?action=install-plugin&plugin=profile-builder'), 'install-plugin_profile-builder') ) ), 'import-users-from-csv-with-meta' ); ?>

select( array( 'options' => array( 'leave' => __( 'Leave the old value for this metadata', 'import-users-from-csv-with-meta' ), 'delete' => __( 'Delete the metadata', 'import-users-from-csv-with-meta' ) ), 'name' => 'empty_cell_action', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'empty_cell_action' ), )); ?>

checkbox( array( 'name' => 'sends_email', 'label' => __( 'Do you wish to send a mail from this plugin with credentials and other data? (email template found here)', 'import-users-from-csv-with-meta' ), 'current' => 'yes', 'compare_value' => $settings->get( 'sends_email' ) ) ); ?>

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

checkbox( array( 'name' => 'force_user_reset_password', 'label' => __( 'If a password is set to an user and you activate this option, the user will be forced to reset their password in their first login', 'import-users-from-csv-with-meta' ), 'current' => 'yes', 'compare_value' => $settings->get( 'force_user_reset_password' ) ) ); ?>

read the documentation before activating this option', 'import-users-from-csv-with-meta' ), admin_url( 'tools.php?page=acui&tab=doc#force_user_reset_password' ) ); ?>

select( array( 'options' => array( 'no' => __( 'No', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Yes', 'import-users-from-csv-with-meta' ), ), 'name' => 'update_existing_users', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'update_existing_users' ), )); ?>
select( array( 'options' => array( 'no' => __( 'No', 'import-users-from-csv-with-meta' ), 'create' => __( 'No, but create a new user with a prefix in the username', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Yes', 'import-users-from-csv-with-meta' ) ), 'name' => 'update_emails_existing_users', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'update_emails_existing_users' ), )); ?>

select( array( 'options' => array( 'no' => __( 'No', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Yes, update and override existing roles', 'import-users-from-csv-with-meta' ), 'yes_no_override' => __( 'Yes, add new roles and not override existing ones', 'import-users-from-csv-with-meta' ) ), 'name' => 'update_roles_existing_users', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'update_roles_existing_users' ), )); ?>
select( array( 'options' => array( 'no' => __( 'Never update passwords when updating a user', 'import-users-from-csv-with-meta' ), 'yes_no_override' => __( 'Yes, add new roles and not override existing ones', 'import-users-from-csv-with-meta' ), 'yes' => __( 'Update passwords as it is described in documentation', 'import-users-from-csv-with-meta' ) ), 'name' => 'update_allow_update_passwords', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'update_allow_update_passwords' ), )); ?>

checkbox( array( 'name' => 'delete_users_not_present', 'current' => 'yes', 'compare_value' => $settings->get( 'delete_users_not_present' ) ) ); ?>
select( array( 'options' => $delete_users_assign_posts_options, 'name' => 'delete_users_assign_posts', 'show_option_all' => false, 'show_option_none' => __( 'Delete posts of deleted users without assigning to any user or type to search a user', 'import-users-from-csv-with-meta' ), 'selected' => $delete_users_assign_posts_option_selected, )); ?>

checkbox( array( 'name' => 'change_role_not_present', 'current' => 'yes', 'compare_value' => $settings->get( 'change_role_not_present' ) ) ); ?>
select( array( 'options' => ACUI_Helper::get_editable_roles(), 'name' => 'change_role_not_present_role', 'show_option_all' => false, 'show_option_none' => false, 'selected' => $settings->get( 'change_role_not_present_role' ), )); ?>

'attachment', 'post_mime_type' => 'text/csv', 'post_status' => 'inherit', 'posts_per_page' => -1 ); $old_csv_files = new WP_Query( $args_old_csv ); if( $old_csv_files->found_posts > 0 ): ?>

   

'attachment', 'post_mime_type' => 'text/csv', 'post_status' => 'inherit', 'posts_per_page' => -1 ); $old_csv_files = new WP_Query( $args_old_csv ); $result = 1; while($old_csv_files->have_posts()) : $old_csv_files->the_post(); $mime_type = (string) get_post_mime_type( get_the_ID() ); if( $mime_type != 'text/csv' ) wp_die( __('This plugin only can delete the type of file it manages, CSV files.', 'import-users-from-csv-with-meta' ) ); if( wp_delete_attachment( get_the_ID(), true ) === false ) $result = 0; endwhile; wp_reset_postdata(); echo $result; wp_die(); } function delete_users_assign_posts_data(){ check_ajax_referer( 'codection-security', 'security' ); if( ! current_user_can( apply_filters( 'acui_capability', 'create_users' ) ) ) wp_die( __( 'Only users who are able to create users can manage this option.', 'import-users-from-csv-with-meta' ) ); $results = array( array( 'id' => '', 'value' => __( 'Delete posts of deleted users without assigning to any user', 'import-users-from-csv-with-meta' ) ) ); $search = sanitize_text_field( $_GET['search'] ); if( strlen( $search ) >= 3 ){ $blogusers = get_users( array( 'fields' => array( 'ID', 'display_name' ), 'search' => '*' . $search . '*' ) ); foreach ( $blogusers as $bloguser ) { $results[] = array( 'id' => $bloguser->ID, 'text' => $bloguser->display_name ); } } echo json_encode( array( 'results' => $results, 'more' => 'false' ) ); wp_die(); } } $acui_homepage = new ACUI_Homepage(); $acui_homepage->hooks();