Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Shaun Taylor
Shaun Taylor
2,654 Points

Using Comments approval system for other post types...

Hello :)

I have a website project on at the moment and it looks like I need a feature similar to the blog comments approval system - where the admin can approve comments in order for them to appear live on the blog post.

The customer would like visitors to submit info via a form on their website.

Once submitted, the Admin would get an email informing them of new info on the website awaiting approval.

The Admin would log into the Wordpress backend, review the info and choose wether or not to approve and publish on to the website, or to decline and not puckish on the website.

  • This got me thinking about the exiting comments system in Wordpress for people who comment on blog posts and how the admin can review and approve or deny the comment to go I've on the site.

Is there any way of adapting this to us in my situation? Perhaps a custom post type that con be submitted from a visitor and then approved in the backend by the admin to appear live on the site?

All thoughts welcome :)

Thanks!!

5 Answers

Brandon Kidd
Brandon Kidd
18,141 Points

I think your end solution when using timeline.js would be to use JSON. There are a few plugins on the WP repository that assist in creating JSON data from the WP MySQL database. Possibly a good start - https://wordpress.org/plugins/tags/json

Anthony Moore
Anthony Moore
2,282 Points

I have used the Gravity Forms plugin to accomplish this. People would fill out a form and would cause a post to be created as a draft. The admin could then go in, review the post and then publish it for it to be live on the site.

There may be other methods to do this, but I found Gravity Forms to be quite easy.

Shaun Taylor
Shaun Taylor
2,654 Points

Thanks for the reply Anthony!

That sounds like a great idea. The next step however would be to integrate it into a plugin I'm planning to use.

ITs a Timeline plugin (http://timeline.knightlab.com) and the user would like visitors to be able to add events to the timeline, only after their approval.

The only problem is, this timeline plugin pulls all of its data from a Google spreadsheet, meaning - once the admin has approved the content, it would need to automatically be inserted into an existing google spreadsheet, saved and published - all with one click!

Alternatively, the site says you can use a JSON database instead of a Google spreadsheet document - which might make it easier I guess... Not 100% sure I know what a JSON database is, let alone how to set one up and add/pull info from it!

Sounds like a nightmare! Any ideas?

Thanks :)

Shaun.

Brandon Kidd
Brandon Kidd
18,141 Points

Is there a specific reason you need to be able to store data in a google spreadsheet? WordPress is already based on an MySQL database, which should be able to handle everything.

I would suggest doing the following:

  1. Create a custom post type for your timeline.
  2. Use Gravity Forms to allow users to post the data to the post type.
  3. If you need an admin display of the results, you could create a new plugin to display this info somewhere in the dashboard. (you could even create the method to publish entries from that view.)

I think at this point, it would be best to keep it simple and determine what both the admin and user need to accomplish and then see how you can accomplish this all within WordPress.

Shaun Taylor
Shaun Taylor
2,654 Points

Thanks brandon - The reason behind the google spreadsheet is this plugin: http://timeline.knightlab.com which is a timeline pugin that pulls its data from a google spreadsheet OR a JSON database according to their site.

I'm just brainstorming options at the moment, but when I sit down with the client next week we should have a much better idea of whats expected and what we can do.

It could be that the system just send the data in an email to the admin and the admin adds it manually - they might be happy with that.

Really appreciate you taking the time to comment (and you Anthony!) :)

Thanks,

Shaun.