WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Directory
[resolved] Accessing form data for output in single entries (15 posts)

  1. studioleland
    Member
    Posted 1 year ago #

    Does anyone know how to accomplish this via php?!

    I see this in the description but no docs:
    "Easily access form data to use in your website"

    I need to be able to access the single field data from the submitted forms. Thanks.

    http://wordpress.org/extend/plugins/gravity-forms-addons/

  2. Zack Katz
    Member
    Plugin Author

    Posted 1 year ago #

    To retrieve data from a lead, you would use:

    $value = get_gf_field_value($leadid, $fieldid, $form);
  3. studioleland
    Member
    Posted 1 year ago #

    This is great! Can you provide php example? Where do I get $leadid? I assume the $form is the corresponding form number? I cam attempting to output a googlemap generated dynamically from address information. I see that I can hook into the single entries output and append data via a functions.php call. I will be doing this. Thanks for the prompt response Zack.

  4. studioleland
    Member
    Posted 1 year ago #

    Zack,

    Are there any pre, post hooks for the directory and entry pages? That would really help me include additional table sorting scripts. Thank you.

  5. Zack Katz
    Member
    Plugin Author

    Posted 1 year ago #

    Tons. Please search the code for apply_filters and do_action.

  6. studioleland
    Member
    Posted 1 year ago #

    Yah,

    Still looking for an action that will allow me to place custom content directly after the single entry details table on the single entry page.

  7. studioleland
    Member
    Posted 1 year ago #

    Not seeing exactly how to place custom content after the single entry table. Did not see any do_action there. Can you assist with a couple simple lines of function.php code for that? Thank you very much. Happy to donate for your time.

  8. Zack Katz
    Member
    Plugin Author

    Posted 1 year ago #

    If it's a lightbox entry, use the kws_gf_directory_detail filter. (in entry-details.php).

    Otherwise, use kws_gf_directory_detail (line 1188).

  9. Zack Katz
    Member
    Plugin Author

    Posted 1 year ago #

    For functions.php:

    add_filter('kws_gf_directory_detail', 'add_my_own_content_after_gf_detail');
    
    function add_my_own_content_after_gf_detail($detail = '') {
    	return $detail.' ...and my custom content';
    }
  10. studioleland
    Member
    Posted 1 year ago #

    As Yes! Perfect. Thank you. Seems I know enough to be dangerous.

  11. studioleland
    Member
    Posted 1 year ago #

    Last response,

    Zack how would I use this function to grab field values for my add_my_own_content... $value = get_gf_field_value($leadid, $fieldid, $form);

    $fieldid = specified;
    $leadid = how to get this?
    $value = get_gf_field_value($leadid, $fieldid, $form);

    Otherwise this has been perfect.

  12. Zack Katz
    Member
    Plugin Author

    Posted 1 year ago #

    When viewing a single Entry in Gravity Forms, the ID of the entry ("lead") is the heading. It'll say Entry #102, for example.

    Also, the URL of that page will look like this, with lid being the lead ID.
    admin.php?page=gf_entries&view=entry&id=4<strong>&lid=102</strong>&filter=&paged=1&pos=0

  13. studioleland
    Member
    Posted 1 year ago #

    Right,

    How do I access that information for use in that get_gf_field_value() function on the single entry table page. I just want to be able to use some address fields to output a googlemap. Thanks.

  14. studioleland
    Member
    Posted 1 year ago #

    Maybe I didn't mention that it will be used dynamically on the single entry page so I will only be able to specify the fieldid and formid. I need to be able to get the leadid from the single entry page.

  15. bunltd
    Member
    Posted 1 year ago #

    I just ran into the same thing using:

    $value = get_gf_field_value($leadid, 22, 1);

    doesn't get the $leadid value on the single entry pages. It works fine if you specify the id as a number. I want to create a link dynamically for example: domain.com/fieldvalue instead of outputting the value of the field.

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.