Hi,
I tried to insert question programmatically, like you mentioned in your FAQ. In fact, I used almost the same sample code you provided (except that I changed Tag Id and names).
Unfortunately it threw me an error.
Link to my sample gist –
https://gist.github.com/atultiwari/2f0a877e9e63c0c4ed334ecf50189308
I have already downloaded the latest one from master branch (and confirmed that manual mode etc are there).
Similarly I tried to post answer, it threw me error – “the server responded with a status of 500 (Internal Server Error)”‘
Link to Gist file –
https://gist.github.com/atultiwari/a7c5cfb43324b08125a2cbec6bd15a02
Answer is getting posted with –
$post_id = wp_insert_post($values);
but not with Hook.
I tried to look for where am I making mistake for hours now, but I am unable to figure it out.
Edit 1 –
After the fixed pushed by @Rahul, questions are getting inserted programmatically, as described. However still there are some issues, such as –
- Tags are not getting inserted (I tried to find out if it’s with me only or it’s an issue with the script, but I couldn’t), while question and category is inserted correctly
- Question metas and activity didn’t get inserted when using sample code provided in FAQ –>I think it’s because of
$qameta
was never used. I found these working if I use the functions “ap_insert_qameta
” and “ap_update_post_activity_meta
” on$qameta
, however I am not sure if I am using the correct method. - When trying similar method to insert Answer, it didn’t insert
post_parent
and answer got orphan. While reading the source code for Answer form and related submit function, I observed that herepost_parent
is passed under the variable named$question_id
, so I tried to pass it like this, but still it failed.var_dump
revealed that while passing the value for$question_id
it’s storing them in array, first is boolean and in 2nd one it’s strong theparent_post
id, which is never used. While if we use the same function on default answer form (when answering the question from GUI),$question_id
stores the parent post id. How? I couldn’t understand it. - Even if submitting answer programmatically started working, it will also need some metas and activity update for answer as well to complete the all steps.
- I think in complete source section of the FAQ line 15 you forgot to put
;
therefore it’s not working at all (out of the box)
Regards,
Atul
Currently there isn’t a way to change the question permalink, but I would really like to. I find that people as their question wrong, and as I respond to questions, I want to improve the question and edit the permalink.
Can you enable this?
If someone leaves a question, and moderation is on, it’s an anonymous post, this is what it shows. That’s pretty bad if you ask me, kills the mood. Instead, there should be a redirect option to a specified page. That would be much smoother and expected, versus this.
I would love to redirect to a thank you page, or an opt-in page, something, anything is better than this.
CANT POST IMAGES HERE, DOESN’T ACCEPT THEM
2 times now I have tried to post a question where I have inserted an image here in the editor. It just sits there after clicking on the submit button.
See https://www.dropbox.com/s/k623b905s3cvofa/Screenshot%202017-11-27%2015.02.10.png?dl=0
Also, I am logged in, but under the button, it says I am not logged in.
The code you have given is of no use. It is very important for SEO as opposed to your assumptions. I suffer from loss of users since the registered pages on Google have changed.
I constantly lose users.
I continue to lose users since it does not send “solved” message. The “solved” message attracts the attention of users.
The site headline must include “solved” message as in the past!
Otherwise, the new add-on is of no use!
Why did you arbitrarily remove this feature which is actively available among options? I expect you to find a clear solution to this problem!
Hello,
I need someone who has been able to work well with Buddypress integration with Askbug.
I do not know how to go about this, but I know it would be very useful to get it functioning. Please contact me through the comment section if you can help out with suggestions and directions on how to go about it.
Thank you
Olufemi
Hi Rahul,
There are some issues with the AnsPress.Io site, which I’ll outline below
1. When logging in from a mobile device, the login window is transparent and difficult to see. If you scroll down the page with the login widget active, it disappears making login difficult
2. Despite being logged in, I cannot post a comment on the first attempt. I get the message”Cheating, are we ?”. I have to reload the page then it’ll let me add my comment. Similarly, attempting to ask a new question yields the same result. Looks like an issue with the login session.
3. Pressing the hamburger in most cases on page load and after posting does nothing. You have to reload the page to get this to work.
Just FYI.
Thanks
Hi.
In question and answer form, how to disable ‘insert code’?
Thanks.