Membership plugin and Gravity forms

Hi all

Gravity forms is a very popular plugin for adding contact and data collection forms to your website.
It uses shortcodes for the place holders of particular forms in the post and page edit forms, which are then replaced with the relevant form on the public side of your site.

Unfortunately it appears that the Gravity forms plugin only registers (adds) a shortcode to WordPress on the public serving side of the plugin and, thus, the shortcode isn't shown in the membership plugins shortcode list.

This can be fixed with the following change to the gravity forms plugin (using v.1.3.13 though a similar change (maybe not the same line numbers) will work with earlier versions:

1. Open up the gravityforms.php file (contained in the gravityforms folder).
2. Scroll down to line 145 and you should see a chunk of code that looks like this:
else{
add_shortcode('gravityform', array('RGForms', 'parse_shortcode'));
add_action('wp_enqueue_scripts', array('RGForms', 'enqueue_scripts'));
}

3. move the line "add_shortcode" from its current position to the line following the "}" so that the above chunk of code looks like:
else{
add_action('wp_enqueue_scripts', array('RGForms', 'enqueue_scripts'));
}
add_shortcode('gravityform', array('RGForms', 'parse_shortcode'));

4. save and upload the changed file to your server.

You should now see the gravity forms shortcode listed in the levels editor and it can be protected like all the other shortcodes.

  • georgef
    • The Incredible Code Injector

    @Barry Awesome. Just getting setup with Gravity forms on a sub blog as part of my membership.

    Just trying to see how this will help. I am planning to hide the entire blog for members.

    How will this benefit?

    Is there a way to 'keep an account' of individual members data and what they submit on the members blog?

  • Barry
    • DEV MAN’s Mascot

    @georgef, it will basically just make the shortcode visible on the admin side of things, if you had shortcodes protected by default in the membership options, the gravityform one would never be able to be released to members of a level (or protected if the shortcodes where visible by default).

    Other than that, it doesn't alter anything else in gravity forms.

    Not sure what you mean by the last question. Example?

  • georgef
    • The Incredible Code Injector

    @Barry thanks got it.

    Is there a way to 'keep an account' of individual members data and what they submit on the members blog?

    Something like account management if that's the right term. Or using the form to keep track of data like you would in your buddypress social profile.

    So let's say user gravity is a member, and in the members area, gravity can add information, let's just say address, city, etc, which can be accessed from the members area and be changed.

    Typing this out, my guess is I'm probably way off with the functionality of this plugin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.