Title: botguy's Replies | WordPress.org

---

# botguy

  [  ](https://wordpress.org/support/users/botguy/)

 *   [Profile](https://wordpress.org/support/users/botguy/)
 *   [Topics Started](https://wordpress.org/support/users/botguy/topics/)
 *   [Replies Created](https://wordpress.org/support/users/botguy/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/botguy/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/botguy/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/botguy/engagements/)
 *   [Favorites](https://wordpress.org/support/users/botguy/favorites/)

 Search replies:

## Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Acting like I'm signed out on the membership options page?](https://wordpress.org/support/topic/acting-like-im-signed-out-on-the-membership-options-page/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/acting-like-im-signed-out-on-the-membership-options-page/#post-5505862)
 * No, there is a WP Super Cache plugin installed but it is not activated.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[amr users] Export CSV without ID column?](https://wordpress.org/support/topic/export-csv-without-id-column/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/export-csv-without-id-column/#post-5355001)
 * Resolved!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[amr users] Export CSV without ID column?](https://wordpress.org/support/topic/export-csv-without-id-column/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/export-csv-without-id-column/#post-5355000)
 * Awesome! Thank you!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323824)
 * krumch,
 * Thanks for the help. In reading the code, I figured it out. Here is how I did
   it:
 * Added a function to my child-theme to auto-login with an automated export user:
 *     ```
       require_once( ABSPATH . 'wp-includes/pluggable.php' );
       function autologin() {
       // PARAMETER TO CHECK FOR
       if(isset($_GET['autologin'])) {
       		$user_login = $_GET['variable1'];
                       $user =  get_user_by('login',$user_login);
                       $user_id = $user->ID;
                       wp_set_current_user($user_id, $user_login);
                       wp_set_auth_cookie($user_id);
                       $creds = array();
                       $creds['user_login'] = $user->user_login;
                       $creds['user_password'] = $_GET['variable2'];
                       $creds['remember'] = true;
                       $user = wp_signon( $creds, false );
                       if ( is_wp_error($user) ){
                          echo $user->get_error_message();
                       }else{
       			wp_redirect('http://www.myurl.com/export');
                       }
       		exit;
   
       	}
       }
       // ADD CODE JUST BEFORE HEADERS AND COOKIES ARE SENT
       add_action( 'after_setup_theme', 'autologin' );
       ```
   
 * So by accessing the right url with the username and password as variables (I’m
   just making this a link on the right person’s desktop), I can autologin and go
   to the page to start the export.
 * On the page itself, I put the php to POST to a the export function (this can 
   be re-factored, but as I said, I’m not too great with php or wordpress):
 *     ```
       <body onLoad="ws_plugin__s2member_pro_export_users_form.submit(); loggeroutter();">
   
       [insert_php]
       echo '<form method="post" name="ws_plugin__s2member_pro_export_users_form" id="ws-plugin--s2member-pro-export-users-form">';
       echo '<input type="hidden" name="ws_plugin__s2member_pro_export_users" id="ws-plugin--s2member-pro-export-users" value="'.esc_attr(wp_create_nonce("ws-plugin--s2member-pro-export-users")).'" />';
       echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_export_users_start" id="ws-plugin--s2member-pro-export-users-start" style="width:100px;display:none;" value="1" />';
       echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_export_users_limit" id="ws-plugin--s2member-pro-export-users-limit" style="width:100px; display:none;" value="1000" />';
       echo '<input type="submit" value="Export Now" style="font-size:120%; font-weight:normal;display:none;" />';
       echo '</form>';
       [/insert_php]
       ```
   
 * I use a plugin to place javascript on that page to submit the form automatically
   and after a few seconds logout of wordpress:
 *     ```
       <script type="text/javascript">
       function submit(form)
       {
       document.form.submit();
       }
       function loggeroutter()
       {
           var LogoutURL = "<?php echo wp_logout_url(); ?>";
           setTimeout(function () {
               window.location.assign(LogoutURL.replace(/&/g, "&"));
           }, 2000);
       }
       </script>
       ```
   
 * Viola! A bookmark on the desktop logs into WP, goes to my export page, downloads
   the S2Member export, and then logs back out. Yes!
 * Thanks to everyone for helping.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323811)
 * So, it looks like I need to access the export() function in exports.inc.php in
   the s2member pro classes. Anyone know how I can do that? It is a static public
   function.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Adding an ID number to each user?](https://wordpress.org/support/topic/adding-an-id-number-to-each-user/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-an-id-number-to-each-user/#post-5323807)
 * Alright, I got the code working, in case anyone is interested. I take the ID 
   of the user and add 150 to it in this version (ours internally is a different
   system). It also includes auto-logging in anyone who registers:
 *     ```
       add_action('ws_plugin__s2member_during_configure_user_registration', 's2_auto_login_after_registration');
       function s2_auto_login_after_registration($vars = array()) {
           if (!is_admin() && $vars['processed'] === 'yes') {
               wp_new_user_notification($vars['user_id'], $vars['pass']);
               wp_set_auth_cookie($vars['user_id'], false, is_ssl());
               //begin assigning id codes
               $numbertoadd = "150";
               $idnumber = $vars['user_id'];
               $idcode = $numbertoadd + $idnumber;
               settype($idcode, "string");
               $custom_fields = get_user_option('s2member_custom_fields', $vars['user_id']);
               $custom_fields['id_code'] = $idcode;
               update_user_option($vars['user_id'], 's2member_custom_fields', $custom_fields);
               //end assigning team codes
               wp_redirect(S2MEMBER_LOGIN_WELCOME_PAGE_URL . '?first');
               exit();
           }
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323763)
 * Should I use the
    add_action(‘init’, ‘c_ws_plugin__s2member_pro_exports::export’,
   3); action to automate an export?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323686)
 * So does anyone know how to call the export function? I’ve been looking without
   much success…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323660)
 * Ok. So I think I understand.
 * Yes, I can get the information I desire by using the export in the “Import/Export”
   menu panel.
 * However, I do not know how to automate whatever function happens when I click“
   export”. If I know what to call and how to access that function, then I can do
   the rest of the automation myself.
 * Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323643)
 * How so? I am trying to automate it and I do not see that ability.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] Automate export of users?](https://wordpress.org/support/topic/automate-export-of-users/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/automate-export-of-users/#post-5323635)
 * I’m Sorry, I wasn’t clear:
 * I can create a CSV from an array of information, but I have not had success on
   creating an array from S2Member’s custom fields (which are kept in meta fields
   I think?). In order words, I know and CAN make a CSV, but I don’t know how to
   get any of the information from S2Member to put into the CSV.
 * Does that make sense?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Hide "My Event" Submenu](https://wordpress.org/support/topic/hide-my-event-submenu/)
 *  Thread Starter [botguy](https://wordpress.org/support/users/botguy/)
 * (@botguy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-my-event-submenu/#post-5238938)
 * Yes, I did, and the link shows up for everyone. It just says “You do not have
   permission to create events” on the “My Events” page. I’d prefer for that link
   not to show up at all.

Viewing 12 replies - 1 through 12 (of 12 total)