sahilmehta
asked 9 years ago

How to make question published after a review.. Means question will go under pending review first and not get published.
I have wordpress default user selected as Subscriber, still questions get automatically posted

sahilmehta
replied 9 years ago

This works but it shows nothing found error on the page

?post_type=dwqa-question&p=27296

as question is submitted for pending review

So how to display a page saying your question has been submitted for moderation ?

4 Answers
BigHug
answered 9 years ago

Hi sahilmehta, 
The pending post will not be shown on the front-end until you log in as admin and have permission to view this post.
Since the post is hidden, it display Not Found page, and regarding to your question, we do not support to have a separate page for this yet.
Regards.

sahilmehta
answered 9 years ago

actually the questions are still visible in the frontend even without logging.
I have checked in different browsers and new questions are still visible without being approved from backed

BigHug
answered 9 years ago

Hi Sahilmehta,

Notice: If you update the latest version of DW Question Answer, your modification in code will be lost, so please check your file again. I will post the solution here again. For Question: open file: ”actions.php” in folder: /wp-content/plugins/dw-question-answer/inc/ and look for:

 $post_status = ( isset($_POST['private-message']) && $_POST['private-message'] ) ? 'private' : 'publish';

Change it into:

 $post_status = ( isset($_POST['private-message']) && $_POST['private-message'] ) ? 'private' : 'pending';

For answer: open file: ”actions.php” in folder: /wp-content/plugins/dw-question-answer/inc/  and look for:

 'post_status' => 'publish'

 Change into:

 'post_status' => 'pending'

Now every time a question/answer posted, you can go to back-end and approve it.

Guru Ghantaal
replied 9 years ago

Has anyone tested this code? As I coudn’t find ‘post_status’ => ‘publish’ in file: ”template-functions.php” in folder: /wp-content/plugins/dw-question-answer/inc/

Cheers!

BigHug
replied 9 years ago

I updated the answer. This line of code was moved to actions.php.
Thank Guru

Guru Ghantaal
replied 9 years ago

Thanx @BigHug!

Its works like a charm now. Just a clarification that there are two instances of

$post_status = ( isset($_POST[‘private-message’]) && $_POST[‘private-message’] ) ? ‘private’ : ‘publish’;

in /wp-content/plugins/dw-question-answer/inc/actions.php

So if one requires question moderation, they need to replace both of these instances with the code provided by BigHug

$post_status = ( isset($_POST[‘private-message’]) && $_POST[‘private-message’] ) ? ‘private’ : ‘pending’;

On another note, when question moderation is enabled, users are shown an 404 error upon submitting a question which is very confusing as they might thing something went wrong and may post again.

I see that now at designWall users see a confirmation of posting a question and a message.

As Hung explained in the post: http://cmspioneer.com/designwall/blog/4-improvements-to-our-qa-community-that-you-may-want-to-do-the-same/ that these features might make their way into the next update.

I think there is a pressing need at least for the confirmation page to be included into an early release next update as you can see.

Thanx again for the update.

Guru
answered 9 years ago

Hi BigHug,
Can you please help, I am trying to get users to be shown a success message as is at DW. 
I have the code in question-submit-success.php in the template folder. But don’t know how to present it to the users when they submit a question. So the asker dooes not get redirected, but the submit form is replaced with the success message in question-submit-success.php.
Best regards
 
 
 

BigHug
replied 9 years ago

Hi @guruji,
I developed a plugin here http://cmspioneer.com/designwall/wp-content/uploads/2014/03/dwqa-ajax-submit-question.zip It is still in the beta phrase, so feel free to test it, break it and please give me some bugs.

Guru
replied 9 years ago

A Big Hug to you, this is fantastic. Thankx alot. Will surely try my best. 🙂

Powered by DW Question & Answer Pro