If you don’t want to give users access to the WordPress admin screens and you don’t want to use a premium plugin, you should create a form in a page and use wp_insert_post with the submitted data.
In your case, the “post_status” parameter could be used to “moderate”:
$post = array(
'post_title' => $_POST['title_field'],
'post_content' => $_POST['content_field'],
'post_status' => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' | custom registered status ] //Set the status of the new post.
);
wp_insert_post($post);
The wp_insert_post function should take care of sanitizing the data before inserting it into the DB, but I recommend to double check and add filters if necessary.
Related Posts:
- Update post counts (published, draft, unattached) in admin interface
- How to Display a List of Users Who Have Made at Least 1 Post?
- Find out who deleted a page or post?
- WordPress: How to get the current logged in author page URL?
- disable password protected page for logged users
- Force “Submit to review” when a post is updated
- Overview with latest edited posts and pages
- Navigation link to specific user page
- Get how many days since last post of the current user
- Hide comments awaiting moderation from user who submitted the comments
- Query All users that has post
- Limit number of posts a user can make per minute?
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- wp_insert_post let users post to without login…broke
- Get user’s most published categories
- Allow anonymous users to post to my site for moderation
- disable column on post and user list
- how to find user ids of all commenters in a post
- How to list users and their post amount?
- Is there any way to allow users to access content before it’s published?
- UberMenu list current user’s posts as menu items
- Create post for every user?
- count the total number of comments the user has received for his published posts
- Restrict users post for himself
- How to allow logged in users to post anonymously
- current post with current author
- How to verify wp user password by sql query in wp? [closed]
- How can i delay reading posing in 3days for not logined user?
- Encountering “Wrong nonce. Action prohibitied.” when trying to alter User Role and unable to Post via WP Admin
- Users problem (multi-author plus multisite)
- How do I manage my users post before publish?
- How do I retrieve a users’ last 5 posts?
- Gather posts into a cart/lightbox and share with another user
- Assign published posts to another user automatically
- Add field to user meta table in database when link is clicked
- Hide comments and posts posted by other user
- Automatically create a default set of posts for each new registered user
- Summary of Posts by an User
- Display a list of users who have viewed the post you are viewing
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- Echo Text If User Is Logged in But NOT the Author of post
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- Show number of posts by logged in user
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Cannot select certain authors for posts after import
- How to limit post (Exception pages) for current user in each role in front end?
- How can get the last post date of the user?
- Is there a way to save different data when USER interacts with the same POST?
- How to display particular categorie’s post which associated to specific user?
- WordPress Delete Users from backend doesn’t work
- Allow users to post their videos to my wordpress website?
- Compare date of user’s last posts
- Add new post only in assigned category
- WordPress each user has each content for a page,how to do that?
- User rank in wordpress post
- Count how many posts a user has viewed
- Allow users to create their own page/s
- Get current user array with post string
- My posts section for logged in user
- Show Custom Post From Logged In Author
- Delete old post with new post
- How to handle dates, trying to calculate time since a post
- each user having category with their name and can add sub categories post in that category
- The post order is different for logged-in and non-logged-in users? [closed]
- User submitted post
- Automatically select category based on user role
- Undefined Function Fatal Error with Shortcode [closed]
- How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?
- Allow users to edit post without logging in
- How to get posts from a current post’s month?
- How do I extract just the post ID of the first item in whatever WP_Query returns?
- How to Use index.php file for “Blog” Page And this is Not a Home Page
- Sort Custom Post Type by Category ID then Post Name
- Which file do I need to edit the All Posts page in the admin area?
- Show metabox value last post excerpt, title and link
- How to remove fresh posts (latest news) on the main page? [closed]
- How to set post status to Delete?
- get_previous_post() while accounting for sticky posts
- How to create a playlist for audio associated with posts per category
- If post does not exist, do something
- Display Parent Category of a Post belonging only to Subcategory
- Calling Permalinks With PHP
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- Posts not showing content after migration
- How to distinguish pages created by woocommerce?
- Mix post date with post meta value using WP_Query
- Please I want to prefix my WP posts title according to each category
- Can the_post_navigation() be outside of the loop?
- Send the post id to a front end edit post form
- How to get the current user post and it’s ID?
- Send and Embed Vine (in WP Post) on Facebook
- How to separate metabox data in front/backend
- FIND and REPLACE wp_posts AND IGNORE custom post type mysql query
- adding custom meta as well as looping through posts
- exclude certain categories from posts
- post_count not working
- Having Issues with in_category , need help
- Query wordpress posts on static page
- How to detect if an ACF custom-field is really in use?
- Get the category of post from which category page it have been clicked