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.

Using the Poll add on for rating posts - how to add the postid to the poll?

  1. Hi All,
    I'd like to add polls to my custom post types. My site is a directory of companies and I would like to add a rating poll (not sure what exactly yet) to each entry. How would I go about adding the post ID to the poll? And then display results (admin and front end) for the poll based on the post ID? I'm sure there are a couple ways to do this and wanted to get some help before starting in on this.

    Thanks for the help!

    Posted 7 years ago on Friday October 26, 2012 | Permalink
  2. Steve Henty

    It's a great idea but it would take a bit of customization I'm afraid. You might want to approach it like this...

    Add the post id to the lead meta on form submission or just use the source_url property of the lead object. Then filter the entries inside GFPolls::gpoll_get_data() and alter the way the data is cached so there's one entry per post_id. Once that's done you'll need to filter GFPolls::gpoll_get_results() to display the right data for the given lead object.

    I hope that's of some help to you.

    Posted 7 years ago on Tuesday October 30, 2012 | Permalink
  3. Yes that does help. I think I will probably just create a a simple poll form plugin for my use. I think it will work out a bit better in the end as I also would like to provide poll results to users on the front end. I am working on adding front end control for the company entries on the site so that the owner of the company can update the information for their company. And I was thinking on having several polls for each entry. Say there are 3 polls per entry, after a user takes Poll #1, then poll #2 would show up and so on. Using my own plugin would make it a lot easier in doing this and storing/displaying the results by using my own DB table. Thanks for the information and helping me decide the best approach for this. Do you think this kind of functionality would/could be considered for inclusion in the poll add-on in the future?

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink
  4. Steve Henty

    It's definitely an interesting idea. I'll give it some more thought and I'll mention it to the team. Thank you!

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink