Post Status setting not working
-
The setting for “Post Status” (Post Status for submitted posts) isn’t working. I have it set to “Publish after 1 approved post”, but they are always set as Pending.
I’ve tried changing the setting to something else and saving, then re-setting and saving changes again, no luck.
Seems like it worked at first, but not any more. What can be done?
Great plugin. Thanks for any help.
-
Not sure, are you using any other plugins? Like maybe a cache plugin? Also, do the other Post Status options work?
I do have a cache plugin, but have flushed the cache many times. Publish immediately works.
What does it use to determine if the person’s posts have been published, their email address?
“What does it use to determine if the person’s posts have been published, their email address?”
No that’s the post status that indicates the status for each post. The user is determined by the submitted username. You can look at the relevant code located in
user-submitted-posts.phpthe function name isusp_prepare_post().I just re-tested this on default WordPress and it’s working normally. Here is what I did (again, on default WP site):
- Set the Post Status setting to “Publish after 1 approved post”
- Visit the USP form and submit a post
- Confirm the post was submitted with “Pending” status
- Publish the post
- Return to the form and submit another post
- Confirm that the second post was published automatically
One other thing that can throw people off is the number of published posts. It’s based on the user, so if the user has published posts that meet the minimum requirement, then all future posts will be published automatically. For testing, it helps to use a completely different/clean browser and submit test posts as a random (not logged in) visitor.
Does the user name submitted have to be a subscriber to the blog for it to work? Most people submitting are not in our case. They are using the same ‘user name’ each time they submit.
No it should not matter if the user is registered (as any role) for it to work. The number of posts is determined per user, based on submitted username.
How can I test how many posts a specific user name has?
It’s not a current feature of the plugin, would require some custom coding.
Must be in the database, right?
Yes all data is stored in the database. It’s not all in the same table though. The submitted usernames are stored in the post meta table. The posts (and thus number of posts) are stored in the posts table.
-
This reply was modified 4 years, 2 months ago by
Jeff Starr.
Okay, thanks. The user_submit_name keys are getting recorded. So, does the plugin check if a post_id associated with the name has been published?
Since the info is getting recorded, it seems like it should be working.
The blog settings are such that the admin has to publish a post, authors can’t do it. Could this be the reason?
-
This reply was modified 4 years, 2 months ago by
jamminjames.
“does the plugin check if a post_id associated with the name has been published?”
Yeah basically. Probably would be useful to just check the code yourself, in the file/function mentioned above.
“blog settings are such that the admin has to publish a post, authors can’t do it. Could this be the reason?”
Not that I recall (I’m not looking at the code currently). It should just count the number of posts for the user. Again, recommend to examine the code, probably would explain it better than I can.
Another idea is to check how it works normally on default WP. Set up a new WP install for testing, leave everything at defaults (theme, plugin, etc.), and then install only USP. That will give you a baseline for further testing, etc.
Okay, I changed the default author’s role to editor, which can publish, and now it works!
So, I’d suggest adding that to your documentation / FAQS – if you’re using a role editing plugin, the default author has to have post publishing capability.
Thanks for your help and patience. Great plugin.
Interesting, thanks for reporting. I will take a closer look at the actual code and see if there is any way to improve existing functionality. And/or add a FAQ as you suggest, in case anyone else experiences the same issue. Cheers.
The topic ‘Post Status setting not working’ is closed to new replies.