// Add the content to $post as an array
$post = array(
'post_title' => $title,
'post_content' => $description,
'post_category' => $_POST['cat'], // Usable for custom taxonomies too
'tags_input' => $tags,
'post_status' => 'draft', // Choose: publish, preview, future, etc.
'post_type' => $_POST['post_type'] // Use a custom post type if you want to
);
wp_insert_post($post); // Pass the value of $post to WordPress the insert function
Related Posts:
- Error when using plugin QuickCache with plugin Mobile Smart ? [closed]
- URL rewrite of independent plugin?
- How do post a Photo to Facebook when a post is published? [closed]
- WordPress : Explain Plugins & Theme string value in database
- Why Does the WordPress Twitter Tools Plugin give a 500 Internal Server Error?
- Opening a link automatically on page load?
- How to display number of page views on a post?
- What is a reasonable memory limit for WordPress
- Get plugin download URL from slug
- Using add_action before add_filter on a plugin?
- How can a wordpress plugin generate pages without posts?
- Calling the_excerpt from inside a plugin template file
- can we modify wordpress plugin version value to avoid update warning?
- How to multiply a post to test internal search results?
- cforms plugin function “my_cforms_logic” (for writing custom logic), is running 5 times
- Best Sitemap Plugin for 1M+ pages [closed]
- Plugins for logo in wp themes? [closed]
- Is there a plugin for automatically adding a word or symbol after a trigger word? I.e. Like a search and replace but more like search and add? [closed]
- Product count in archive page Title in WooCommerce [closed]
- How to display the featured post on the category page?
- Disable globally “Crop thumbnail to exact dimensions (normally thumbnails are proportional)” with Multisite
- UTF-32be error WordPress
- wp-admin send 404 error
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Customize Menu | Styling LESS/SCSS code formats
- get_term_meta returns false in widget
- How I update WordPress theme and plugins
- WordPress Mailerlite – How to include mailerlite SDK in plugin
- How to Show Author image and url in WordPress plugin directory? [closed]
- Renaming Custom Taxonomy Values
- Load plugin script in specific page
- How to change php variable value using wp setting api
- jQuery code didn’t run on my plugin
- Call ajax on the frontend
- Not able to override plugin’s default css rules
- Is this plugin safe to run?
- Custom characters of tinymce editor are saved as question mark
- Language translation on a fresh english installation
- How do I profit from a Plugin?
- Color Picker UI in admin is not correct
- Can I customize an Elementor template after inserting it? [closed]
- Themes conflicts and overrides my WordPress Support widget Plugin styles
- Disable Author Archive just for certain roles in bulk
- Create automatic latest version link
- Some error in mysql script ? Can’t working to create table
- Gutenberg: Prevent links from being clickable in the block. Error: “Cannot destructure property ‘frameElement’ of ‘r’ as it is null.”
- How to Access a file that is inside a plugin’s dir from the theme’s `functions.php` file
- Managing and deleting transients with dynamically generated transient names
- I created a plugin with ‘view page’ that uses MYSQL + PHP. When I use wp_insert_post(), it turns everything to HTML
- list of custom post by custom field in frontend
- How to add a prefix to a WordPress post preview url?
- i can not access the post in custom template of my wordpress plugin
- Sharing varible between two add_actions
- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- Allow editor user to full permission to access plugin settings
- how to upload folders and files to google storage bucket?
- Elementor JetEngine Listing Grid paging option
- Admin menu hilighting wrong item for CPT
- ajax voting for custom post type
- Change (replace) word in metabox
- Exclude Tag Links from and Text
- Automatic set a featured image from the first image’s url (or tag) in the article
- flip horizontal images in bulk
- How to remove row action “Edit with Visual Composer” in the post list table?
- Flowplayer – Warning: Division by zero
- Why all my wordpress sites keeps telling me that everything is up to date at /wp-admin/update-core.php?
- How can I save cookies to members
- How to use get_user_by in plugin
- Defined user role to access plugin’s pages
- How to add wpmode in Flash Embed Code in WordPress Site?
- Inactive Plugin Files
- Better code/text editing for posts and pages?
- Any way to edit/crop my featured image upon uploading?
- Saving an array to get_options
- How to set different users for different pages?
- Strip shortcode from excerpt [duplicate]
- force category table refresh when adding new category
- HTTP Error 403 When Trying to Login
- plugin’s script and style enqueing not working on Thesis
- Posts 2 posts plugin loop echo the_title not working
- Help me with my first very basic plugin
- How can I server scaled images?
- WordPress site down after installing a plugin. Can’t connect with FTP with correct details
- add query string to all pages after user logged in
- get_post_meta does not work
- Loading Canvas & WooCommerce translation file in child theme
- Plugin that resets database and deletes all content, plugins
- Custom Fields on User Dashboard?
- Make a Custom template for a specific category in wordpress
- HTML link within my plugin settings page
- ACF: Not displaying ACF data from another post
- True or False: Is an Apache error or PHP error the same as a WordPress error?
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- In WordPress, after installing “Pie Register” plugin, admin permission is GONE! [closed]
- The plugin has been used here? [closed]
- Self-hosted Plugins & Themes store with auto-updates? [closed]
- Woocommerce Export Orders with Order Item Meta
- How to create a sharing marketplace with wordpress for bicycles?
- Looking for membership style plugin with edit option [closed]