PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Shortcodes causing problems with Gravity Forms shortcodes

  1. I have added a couple of lines to my functions.php (http://pastebin.com/w2VUuLBK) and then using a [member] shortcode to hide a gravity form from users who are not logged into the site. It works, but when you are logged in, it only shows the gravityforms shortcode rather than the actual form - this is what appears rather than the form( http://pastebin.com/YWt49W0g ). Any suggestions what I'm doing wrong here or why the form won't appear? Thanks very much

    Posted 13 years ago on Friday October 7, 2011 | Permalink
  2. The issue is your shortcode is parsed but your shortcode isn't parsing shortcodes in it's content. So you need to configure your shortcode so that it too passes the content through the do_shortcode call. See this codex page:

    http://codex.wordpress.org/Function_Reference/do_shortcode

    Posted 13 years ago on Friday October 7, 2011 | Permalink
  3. Also, in 1.6, Gravity Forms has a built in function to show a form only to logged in members, and can show alternate content if the user is not logged in.

    it's described on this page near "Form Settings Enhancements":
    http://www.gravityhelp.com/gravity-forms-v1-6-beta-1-released/

    Posted 13 years ago on Saturday October 8, 2011 | Permalink
  4. Hi again, sorry to be annoying but my knowledge of php and stuff isn't great. I did some reading and believe I have found the code to adjust the shortcode parsing which i believe is this ( http://pastebin.com/h8PNuSm0 or http://pastie.org/2670244 ) but i'm not sure how to apply it to my existing php here ( http://www.pastie.org/2670170 ). Any chance you could help me out with this? Thanks for all the help, the forms are working perfectly and all the forum support has been really helpful.

    Posted 13 years ago on Monday October 10, 2011 | Permalink
  5. anyone able to help with this small bit of php code i need to parse my shortcode? thanks

    Posted 13 years ago on Monday October 10, 2011 | Permalink
  6. Problem solved.

    For anyone looking to create gravity forms that only appear to a visitor or logged in user, add this code to your functions.php file ( http://pastie.org/2671581 ) then simply add the shortcode [member] [visitor] around the desired form. Thanks for the advice on this carl and chris!

    Posted 13 years ago on Monday October 10, 2011 | Permalink

This topic has been resolved and has been closed to new replies.