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.

How to get form entries and use them in my WP theme?

  1. potspotdev
    Member

    Hi there,

    I'm looking for a way to get entries generated by a particular form and manipulate them in my template (via the front-end). I checked the documentation and some other forum threads, but I was unable to figure it out. Is there any way to do that without making direct queries to the db?

    Thanks in advance

    Posted 6 years ago on Tuesday February 5, 2013 | Permalink
  2. David Peralty
    Administrator

    Can you give us more information on what you are trying to do? Are you trying to edit previously submitted entries, or display entries like blog posts? Depending on what you want, those are very different answers.

    Posted 6 years ago on Tuesday February 5, 2013 | Permalink
  3. potspotdev
    Member

    Hi David,

    Thanks for your answer. To be more specific, I'm trying to get all entries that a particular forms creates, filtering them by an entry value. Then I'll list them with foreach and add a delete button to each of them.

    Hope that makes sense.

    Posted 6 years ago on Tuesday February 5, 2013 | Permalink
  4. Take a look at get_leads in forms_model.php (around line 2467 in the current release):

    function get_leads($form_id, $sort_field_number=0, $sort_direction='DESC', $search='', $offset=0, $page_size=30, $star=null, $read=null, $is_numeric_sort = false, $start_date=null, $end_date=null, $status='active')

    You can use that at its most stripped down like this:

    $leads = RGFormsModel::get_leads($form_id);

    That will return an array of leads for all entries made for $form_id. You can process those however you like.

    Posted 6 years ago on Wednesday February 6, 2013 | Permalink
  5. potspotdev
    Member

    Thanks

    Posted 6 years ago on Thursday February 21, 2013 | Permalink
  6. Hello, I've been using

    $leads = RGFormsModel::get_leads($form_id);

    Which has been working fine but after 30 leads, I don't get anymore. It seems to stop, even though there are more entries in the database.

    Do I need to set a variable somewhere ? like $page_size?

    Posted 5 years ago on Monday June 3, 2013 | Permalink

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