Found this snippet after more searching:
//Force posts of custom type to be private
//…but first make sure they are not 'trash' otherwise it is impossible to trash a post
function force_type_private($post)
{
if (($post['post_type'] == 'post')
{
if ($post['post_status'] != 'trash') $post['post_status'] = 'private';
}
return $post;
}
add_filter('wp_insert_post_data', 'force_type_private');
Changed the boolean to:
if (($post['post_type'] == 'post')&&(!current_user_can('administrator')))
This makes sure only admin can publish.
Related Posts:
- How to Display a List of Users Who Have Made at Least 1 Post?
- Let private posts stay in status “private” after edit through “editors”
- featuring old articles without messing up with the archive
- Setting post meta data to random value during post status transition / on publish
- How to change post status from publish to draft using hook in wordpress?
- Hiding by default specific post status on backend list?
- Enable commenting on front-end preview page for pending posts
- Custom Post Status Posts viewable to the public
- How can a guest view the “Pending Review” Post?
- How do I batch create revisions of all posts?
- add filter to “quick edit menu” in wordpress admin
- ‘transition_post_status’ only fires when pressing “Add New”
- What differences are there between a Privately Published post and a Draft post?
- Update post status from “publish” to “trash” for half of posts
- how to remove dash (-) post status from post title on posts listing page wordpress
- How to change post status from frontend?
- Posts and Attachments with “Published” status in Search
- Admin – create custom post status and display above table
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- $post->post_type not working
- how can i allow users to view their own pending posts in a front-end page
- Is there a way getting post fields using `transition_post_status`
- What function publishes a post when you click the publish button?
- Post Status Frontend Announcement
- Display amount of pending posts in back/front end
- Showing posts for today and future
- Show Last Revision Of Post That Has A Published Status On Single Page
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Updating post status via rest api
- How publish post from pending status
- Hide or remove custom post status
- Put page on Archived statut after end of publication date
- get_next_post() not working with future post status
- Modify loop to include all post statuses not just ‘published’
- Function/filter or plugin to change post status based on custom field value
- get_posts includes “auto drafts”?
- I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in publish
- Post Format Status [closed]
- Do anything on post_status change [duplicate]
- How to get post creation date?
- Setting Custom Sort Order of Posts within a Category
- Display post number not post ID number
- Change slug with custom field
- Remove double space after a period
- Displaying the number of posts in a custom loop (without including the number of posts of a loop below)?
- display order of connections
- Conditional that checks if a current category has any subcategory with posts
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Add code just after Post content
- Alternating post layout
- Check to see if specific loop has less than certain amount of posts
- How can I show many posts an author has per week?
- Disable inline_edit() on edit.php
- Display post X of Y in category
- Ajaxify This Code
- How do I display some posts fully on the homepage, and some as an excerpt only?
- How to bulk add vast amounts of posts
- Users problem (multi-author plus multisite)
- Filter only the text in the_content
- How to WP_Query() from multiple blogs and order them?
- How to get subcategories from category slug?
- Hide a specific post from a page template
- Posts – display all posts except a post by an ID
- Subdomain to website directory blog transferring
- Display author’s name and avatar in post’s sidebar
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- Parent category / child category posts
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- How to check if a post is published today?
- Detecting current page from class method
- How can I add a class to particular paragraphs in my post?
- Exists filter or action that change Add New Post link?
- saving/reading custom field value does not work – no value gets POSTed
- Getting an extra post’s meta data?
- How come this loop is not working? [closed]
- Adding external field to my post form (admin side) and to post show (frontend side)
- fetching posts and showing on frontpage
- Link from Post to Another Post Via Clicking on Words within Original Post
- Insert JavaScript in a blog post or a new page?
- Order buttons added to TinyMCE
- How to create loop of posts except post ID defined via ACF field
- How to pull sticky post permalink inside php?
- how to put post customized in page
- How to redirect if is post edit or publish page?
- How to delete/customize imported demo content from a theme or add my own?
- testing result of $.post with json_encode
- Clean up customize_changeset in DB
- count_posts to a standalone link
- Add a unique meta desciption
- Blog styling in SASS
- Get results from the main wp_query
- Comment Authors of Post On Front Page
- Preview own posts if logged in
- Pagination for custom query won’t let me back on page 1
- thumbnail image path and file path for gallery thumbnail images
- How to add a new page that will function as a separate blog/news article page
- How to set value in Query Loop?