Support » Plugin: Gravity Forms: Post Updates » totally lost – can't get any shortcode to work

  • Resolved peteratomic

    (@peteratomic)


    Maybe missing something in the instructions as I’m not a developer and usually can’t connect dots if details are missing.

    * I have a form that successfully creates a new post.
    * I have tested every code example in my single.php file and nothing works
    * the first example in the “URL QUERY VARIABLE” section simply refreshes the page and nothing happens
    * the second example in the “URL QUERY VARIABLE” section produces a 404 not found error
    * tried all of the examples in the “IN TEMPLATE” section and nothing happened

    Maybe someone needs to a write some instructions for non-developers because I’m totally lost and getting nowhere with this. Totally desperate to get this functionality running.

    https://wordpress.org/plugins/gravity-forms-post-updates/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jupitercow

    (@jcow)

    Have you tried using the shortcode?

    I would need some examples to understand the problem. How you including the form? And how have you included the working form that creates new posts?

    Anything you can provide. Right now I am not really sure what you have on your hands.

    Thread Starter peteratomic

    (@peteratomic)

    Thanks for getting back to me so quickly. 🙂

    I have a page with a GF submission form that creates a custom post type built using WPMUdev’s CustomPress.

    I tried adding all of the shortcodes in your IN TEMPLATE section, dropping them into my single-custompostype.php file, assuming of course that it should use a php tag:

    <?php do_action('gform_update_post/setup_form'); ?>

    But none of those worked. I did just get the idea to wrap your shortcode into a do shortcode command, but the problem there — even though the form shows up — is that it shows up for everyone. I would think the point would be to make the update option available to whoever submitted the form in the first place, not any logged in user. Or maybe that’s not possible with this? Or am I still missing something fundamental?

    Thread Starter peteratomic

    (@peteratomic)

    Here’s a test post in case it helps…

    http://resonate.is/songs/making-flippy/

    Plugin Author Jupitercow

    (@jcow)

    I am working on a number of updates, and some new documentation, but the new update should help simplify adding a form now.

    First. Now it works a little harder to only show edit links and forms to users who actually have the right to see them. At least through the shortcodes.

    Also. You can make the form and edit links work together better by requiring the edit link be submitted before the form shows.

    So now you can add the below shortcodes to a post and only the link will show up when a user has the right to edit the post and the form will only show up once the link has been clicked on.

    [gform_update_post_edit_link]
    
    [gravityform id="1" title="true" description="true" update require_link]

    This is very basic, but also allows a very basic starting point that works a little more like people expect I think. This would make the post editable on its own page.

    The new attribute for the shortcode is: require_link.

    This will get better documented later in the week along with some other updates.

    See if this helps.

    Thread Starter peteratomic

    (@peteratomic)

    Awesome! It works perfectly!

    Tried require_link it and it works. tyvm for it!

    2 suggestions:
    1) Add a “cancel” / exit sort of feature (like changing the “Edit Post” link to a “Cancel Editing Post” link, which is essentially like hitting the BACK button)
    2) Instead of hard-coding “Edit Post” as the link, pull the post type’s name so the link says “Edit MyCustomPostType”

    Plugin Author Jupitercow

    (@jcow)

    You can change the link text… but the short code wouldn’t allow what you are talking about I guess. The template function would. And you can add a cancel button in code, but I will look at adding it myself perhaps… Might be tricky with the gf shortcode though.

    2) I’m saying instead of hard-coding “Edit Post”, it should dynamically pull the post type’s singular_name via https://codex.wordpress.org/Function_Reference/get_post_type_object (or another way)

    This short code requires searching posts of new products and finding the post ID.
    [gravityform id=”1″ update=”34″] // Loads post where ID=34 for editing

    How can I set the post id in code?

    Thanks,

    Dovberman

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘totally lost – can't get any shortcode to work’ is closed to new replies.