Default Category for Submission
Author | Posts |
---|---|
April 10, 2013 at 3:06 pm 1992 | |
Tareq Hasan | I am after the same functionality that the free version offered. I do not want users to see any category selection on the front end while posting. all posts are going to one category, so any kind of option on the front end is superfluous as creates a bad UI. Please help. Thanks Rich |
April 10, 2013 at 3:26 pm 1993 | |
Tareq Hasan | The removal behind the default category is: you might have a post type that doesn’t support “category” taxonomy. So it becomes pointless. Although, you can set the default category by adding some code. if ( $expected_form_id == $form_id ) { add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_set_default_cat’, 10, 2 ); Put the code to your themes |
April 10, 2013 at 3:34 pm 1994 | |
VVV | Hi Tareq. Thank you for your response. I appreciate what you are saying, but must disagree. It is not pointless, the option may become redundant if the post type does not support category. I have 2 different forms, each to post to 2 separate categories. In this instance, the option would have been very handy. Would it not make sense to have the option there if required?! What would the work around be? |
April 10, 2013 at 5:11 pm 2001 | |
Tareq Hasan | I also understand your concern. You are seeing it from a user perspective and I am seeing it from my developer perspective. There might be a settings in a next release for default “category” taxonomy. But for your workaround right now, I only can give you that code snippet. Change the category ID and form ID as you need. if ( 347 == $form_id ) { // change the number to your form ID if ( 372 == $form_id ) { // change the number to your form ID add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_set_default_cat’, 10, 2 ); |
April 10, 2013 at 5:24 pm 2002 | |
VVV | Thanks again Tareq I will implement the code and get back if there are any issues. Many thanks again. Rich |
October 30, 2013 at 8:10 pm 9606 | |
Marie-Hélène | Hi Tareq! |
October 30, 2013 at 11:14 pm 9612 | |
VVV | Hi Marie-Hélène. Best wishes |
April 22, 2014 at 9:02 pm 19243 | |
Dana | I am a new user and I am also having trouble with this. I need all front end submitted posts to go to a “User Submitted” category along with the category chosen in the actual form.. So each user submitted post will automatically show up in two different categories? I have my default category chosen as “user submitted” and a category for them to choose in the actual form, but it only shows up in the one they choose and not the default “user submitted” category.. Any way to work around this? Thanks |
April 23, 2014 at 5:02 pm 19285 | |
Tareq Hasan | The both will not work at once. It’ll pick the category if it exists in the form, otherwise the default category will be used. |