The post_category needs to be passed as an array of category IDs (even if you’re only adding one category).
Try this:
$post_data["post_category"] = array( $catslug->ID );
Related Posts:
- How do I show data from gravity forms in my template? [closed]
- How to Display Product specific to a category with WooCommerce Plugin? [closed]
- How can I allow commas in tag names?
- Get the category from an ID of a product?
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- Way to force media uploader use custom image size
- Get selected values from checkboxes and radio buttons via Gravity Forms gform_after_submission hook [closed]
- Restrict individual category combinations
- Disallow a user to post in certain categories
- Restrict access and display for categories
- Qtranslate displays empty categories with get_categories()
- Plugin for changing a post’s category based on it’s post date?
- Plugin to set all Posts in a certain Category to a certain Post Format
- Woocommerce category description as subtitle
- Get subcategories with JSON API plugin
- How to display a category list in a mediawiki like way?
- How to show custom static content at top of each category page?
- How to use get_categories() with Event Organiser plugin
- Server-side subscribe by email?
- plugin for wp_list_categories with posts
- Set a category for a page
- Displaying Gravity Form data on WordPress page [closed]
- Placement of Code in Plugin for hooking `save_post`
- Show Heirachy of categories in WP Download Monitor
- Precheck fields when I add a new post
- How to capture hidden values with Gravity Forms
- What plugin would make this happen? If is the theme
- How to use third-party SendGrid Email Validation API in Gravity Forms?
- add_action(‘the_content’, ‘my_plugin_content’) is null
- Store GravityForm data in phpmyadmin (mysql)
- Issue Saving Posts That Contain Shortcode
- automatically set random featured image by category in wordpress on post
- how can I edit the HTML of yith ajax product filter
- Unset plugins on front-end belonging to specific category
- WordPress Categories as a Grid
- On save_post need to wp_insert_post and save partent post id to child post and child post id to parent post
- Trying to remove a couple categories from shop page
- Configuring default woo commerce login with modal popup
- How to allow editors to only edit certain categories?
- Category as Subdomain for One WP Install
- Generating shortcode and HTML on button click
- Taxonomy Category Icon on index page
- Woocommerce categories displayed on every category and shopping page
- woocommerce product search based only title
- Ajax Load More on Hierarchical Categories
- Sub Categories in drop down menu
- How can I display a list of only categories which are marked as ‘featured’ in the backend?
- Related post based on 2 categories
- View more posts of a sub-category
- How to insert category name above post title in a featured pages plugin?
- Authenticating custom field on login
- trying to create simple plugin to filter categories from all authors
- Displaying saved category checked in a plugin?
- WordPress Categories from Plugin
- Show all posts of all categories but excluding a category on custom blog page with pagination of my theme
- Showpost and last
- Is it possible to setup Category wise Subsciption?
- How to use categories in the URL with Advanced Custom Fields?
- Using a Cron Job to dynamically populate a field ONCE, and then making the field blank the next time someone visits page
- Filter EVERY category link with my plugin
- Category archive in menu
- Carrying information from button click into form [closed]
- CSV file header
- GravityForms to Salesforce API, problem with people who leave out company [closed]
- Find And Add Category to Posts
- Retrieve post thumbnails
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Pagination in category
- How to add character to content of post?
- Editing “Kahi’s Highlight Used Categories” plugin code – highlighting parent and child category in post page
- Problem with executing a function on saving a post
- single.php fires more than once after clicking on any post to view with different post id each time
- How can I add the custom taxonomy categories to the posts and pages?
- Twitter List Tweets and Delicious Links as Posts
- Display static pages instead of category, in code
- WordPress “Categories to tag converter” not working on imported Blogger posts
- wp_insert_post_data filter to set category
- What happened to WP No Category Base?
- 404 not found problem with URL rewrite custom category
- Is there a way to combine categories and their hierarchy into the admin listing page?
- Automatically set posts to NoIndex depending on category?
- Make a Custom template for a specific category in wordpress
- formatting the way posts show up
- woocommerce retriving category name as div class?
- query_vars in plugin when using custom permalinks
- How to pre-set WordPress settings for specific posts?
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- hide particular category post from front page only [closed]
- How to make horizontal scrolling menu [closed]
- How to modify submit button on GravityForms
- Create WordPress category dynamically
- Can i have limit posts on a specific category and automatically remove older ones?
- Gravity Forms and Gravity View Permissions
- Show WooCommerce products based on query parameters on redirect
- Categories not showing when all of the posts are private
- How to add portfolio category post count in main navigation menu?
- Gravityforms login form custom redirect if form not submitted
- Need a Category List for the category slug
- How can I disable links for categories but keep showing them on my blog in an Elementor Template?
- How to check if the post exists in any of the categories?