• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Filters » Remove the login form from completed registration

Remove the login form from completed registration

Chad Butler · Mar 28, 2012 ·

In the case of moderated registration, where the user may not receive access to the site right away, you may find that you want to show the successful registration message, but eliminate the login form that shows below it by default.  Here is a method to do that using the wpmem_login_form filter.

This article is only available to WP-Members Support Subscribers. If you have an existing subscription, please login below. If you do not have a current support subscription, you can purchase a support subscription here.

Already a Member? Log In Here
   
Forgot password? Click here to reset

To gain full access to WP-Members premium content, a current support subscription is required. You can purchase an annual support subscription for as little as $59, which provides you with access to priority support, a customer support forum, access to code snippets, and more.

Why wait? Choose your subscription option here.

[
Why join?]

Filters filters, hooks, tips, wpmem_login_form

Welcome to RocketGeek Interactive › Forums › Remove the login form from completed registration

Tagged: filters, hooks, tips, wpmem_login_form

  • This topic has 12 replies, 3 voices, and was last updated 3 years, 9 months ago by Chad Butler.
Viewing 8 reply threads
  • Author
    Posts
    • May 4, 2012 at 12:54 pm #517
      Chad Butler
      Keymaster

      In the case of moderated registration, where the user may not receive access to the site right away, you may find that you want to show the successful
      [See the full post at: Remove the login form from completed registration]

    • July 8, 2014 at 12:13 pm #5337
      Omarben
      Participant

      Nice and simple and working!
      I’m creating a two step registration where you are asked to add some additional information after initial verification and validation.

      I’m planning on passing variables from first reg form to second form through the url:

      url.com/?first_name=omarben

      and then re-populating the already filled in form fields with js.
      This way it will appear like the fom just adds more fields dynamically but keeps the information you have.

      Any hooks that might help would be appreciated as well as js that already does that.

      • July 8, 2014 at 1:24 pm #5339
        Chad Butler
        Keymaster

        That’s a nice idea that has come up in questions before. I don’t have anything specifically written at this time as an example, but you can review the hooks for registration here.

        I think to make the whole thing run off JS would give you the best user experience. To do that, you probably want to load the entire form and use JS to hide the extra fields. I would do it like this:

        1. Load entire form, JS hides extra fields & submit button, JS displays submit button to validate initial fields (preventing form from being posted until fully complete).
        2. On initial submit, JS validates, then displays extra fields and submit button for allowing form to be posted to server.

        That’s the way I think it would flow – sorry I’m not a JS developer, so I wouldn’t be much help beyond concept.

        A less elegant way might be to have initial form displayed by filtering out the extra fields with wpmem_register_form_rows. Use the following nested shortcode:[wpmem_logged_out][wp-members page=”register”][/wpmem_logged_out]

        Then once the initial form is submitted, log the user in automatically so that the following nested shortcode is displayed:
        [wpmem_logged_in][wp-members page=”user-edit”][/wpmem_logged_in]

        Not as elegant as the JS approach, but it might work.

    • July 8, 2014 at 6:38 pm #5344
      Omarben
      Participant

      I’m only doing the js out of necessity of client and server side data. But yes to in future completely js forms.

      You suggestion doesn’t work in my situation for the main reason that I have admin approved registration. So I can’t log them into get the rest of the data.

      Might help if I explained my site:

      1) User Fills out Initial Registration form (with hidden “CODE” field”)
      2) Upon submit:
      A) my_reg_hook_filter/wpmem_pre_register_(validate/sanitize phone1)
      B) Send SMS of a random 5 digit code to phone1
      3) Then redirect user to my custom register page (same as initial with new field “CODE”)
      4) My vbs script populates the values they have already filled in.
      5) They enter code and submit
      6) My wpmem_ef_validate_extra_fields checks there code and allows registration to complete or not

      Its all working except #3
      Any idea on best way to redirect using js that will preserve my parameter pass “?first_name=” …

      BTM
      I’m trying to do this all with your hooks and filters and not modifying your code.

    • July 8, 2014 at 10:06 pm #5345
      Omarben
      Participant

      got it working:

      Here is how values from first form are passed to second form:

      $url = ‘http://website.dev/code-validate?first_name=’ . $fields[first_name] . ‘&last_name=’ . $fields[last_name] . ‘&phone1=’ . $fields[phone1] . ‘&user_email=’ . $fields[user_email];

      echo “<script type=\”text/javascript\”>window.location = \”” . $url . “\”;</script>”;

      In page That has calls second form

      [wpmem_register_heading_empty][wpmem_remove_register_tag][wp-members page=”register”]
      <script type=’text/javascript’ src=’http://website.dev/wp-content/plugins/my-functionality-plugin/fill_form.js’></script&gt;

      <script>// <![CDATA[
      fillform();
      // ]]></script>

      fill_form.js:

      // Iterate through tags and fill fields

      function getQueryVariable(variable) {
      var query = window.location.search.substring(1);
      var vars = query.split(“&”);
      for (var i = 0; i < vars.length; i++) {
      var pair = vars[i].split(“=”);
      if (pair[0] == variable) {
      return pair[1];
      }
      }
      return(false);
      }

      function fillform() {

      // Iterate through a known list of tags
      var tags = [“first_name”, “last_name”, “phone1”, ‘user_email’];
      for (var i = 0; i < tags.length; ++i) {
      var param = getQueryVariable(tags[i]);
      if (param) {
      var userNameField = document.getElementById(tags[i]);
      userNameField.value = param;
      }
      }
      }

      • July 8, 2014 at 10:56 pm #5346
        Chad Butler
        Keymaster

        Thanks for the update – glad you got things working!

    • July 9, 2014 at 5:45 pm #5347
      Omarben
      Participant

      just need to figure out why none of my notification emails are firing now.

      Not even the email when the user is activated in the back end.

      Since wp-members is not in the registration loop when the admin activates the user
      what hook is picked up and where that triggers the send of this email?

      “Registration is Moderated, User is Approved”

    • July 10, 2014 at 12:37 am #5349
      Omarben
      Participant

      I loaded your email tester and checked all types and fired them off and they all arrived.
      Some how that flushed out my email pipes.
      Suddenly the last unsent notification email that should have been sent 20mins earlier was sent and now they are all sending.

      I loaded the test mail sender to get email working – and it DID!

      The two part registration is going to be used again to require two more fields down the road.

      Its really more like:
      pre-registration
      registration
      post-registration

    • March 5, 2015 at 6:43 am #7343
      Omarben
      Participant

      Check below which emails you would like to send:

      New Registration Email
      Registration is moderated (pending)
      X Registration is moderated (approved)
      Forgotten password reset
      Admin notification

      When I check Registration is moderated (approved) test email.

      2 yhings happen.

      1) a screem of errorrs
      2) The password for the user I’m logged in asd getcs chnaged in the _useres table and I have to use PhpMyAdmin to reset the user password!

      Here are the errors.

      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 883
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 884
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 885
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 886
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 887
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 888
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 891
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 892
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 893
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 894
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 897
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 898
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 899
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 900
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 861
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 862
      Warning: Cannot modify header information – headers already sent by (output started at wp-admin/includes/template.php:1812) in pluggable.php on line 863

    • March 5, 2015 at 3:48 pm #7344
      Omarben
      Participant

      MY BAD
      I THINK THIS IS ALL MY DOING !

      I think all of these errors are caused by wordpress not liking that I change the password in the email

      These errors are all related to security cookies

      oops!

      carry on 🙂

      • March 7, 2015 at 1:46 pm #7356
        Chad Butler
        Keymaster

        If you did indeed get things working, that’s good to hear. If not, let me know.

    • June 2, 2017 at 8:52 pm #13079
      Crisbella
      Participant

      Newb question but where exactly do I add this code above? 🙁

      • June 2, 2017 at 9:33 pm #13080
        Chad Butler
        Keymaster

        That’s a totally legitimate question.

        Generally, you can add code snippets to your theme’s functions.php file. Another possibility is to create a custom plugin file to store any custom code snippets.

        There’s also a good post in the Basics category that talks about how to use code snippets from the site. You can read that here.

        And if you run into any trouble, let me know either in the forum or via the contact form.

        Hope that helps.

  • Author
    Posts
Viewing 8 reply threads
  • You must be logged in to reply to this topic.
Log In

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy