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]
- Get the category from an ID of a product?
- Disallow a user to post in certain categories
- Restrict access and display for categories
- Qtranslate displays empty categories with get_categories()
- Plugin to set all Posts in a certain Category to a certain Post Format
- How to display a category list in a mediawiki like way?
- How to use get_categories() with Event Organiser plugin
- Displaying Gravity Form data on WordPress page [closed]
- Show Heirachy of categories in WP Download Monitor
- Custom Post Type Plugin not loading category template and loading 404 instead
- Display content from custom post type if match to main post category
- Getting a List of Categories for Use in a Plugin?
- WordPress category add image field
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- Solutions to repost categories into multisite blogs?
- Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]
- How to save post change url youtube link?
- Assign post format to categories
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Excluding a category from wp_query breaks recent post widget
- Trouble with editing template for “List category posts” plugin
- Any built-in function to associate a post to category through a plugin?
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Migrating hosts, 500 errors and plugin issues
- Automatically Assign Author to Category [closed]
- Custom Pages for Woocommerce Product-Category Pages
- polylang + category/tag custom language link
- wp_enqueue_script registers script but does not create html tag
- How to display taxonomy images with wp_list_categories?
- Using arbitrary paths in page urls
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- populating a form field with output from a custom plugin function
- How do I rename a category in the menu bar only?
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- Is changing post from category in a large blog a good practice?
- Best/Correct way to add an option to a category
- How to set category correctly for a custom post created by a remote API call?
- Merge tags in multistep Gravity Form?
- .php file for woocommerce edit category? [closed]
- Gravity Forms returns to odd position
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Mutliple users editing single document in wordspress
- How to add category and subcategory in WordPress custom code?
- How can recognize post’s category?
- Category “same post” retreive and display
- help intercepting save_post through plugin
- Add a new category for posts
- how to resubmit a submitted form with gravity forms plugin
- how to show all posts of each category in pages
- Custom Post Type same name as Category
- Bookmarking custom template pages which all have the same page ID
- Display posts by alphabetical order
- How to display category list with category featured image
- Getting the same post on my related post
- Precheck fields when I add a new post
- How to capture hidden values with 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
- WordPress Categories as a Grid
- Configuring default woo commerce login with modal popup
- How to allow editors to only edit certain categories?
- Category as Subdomain for One WP Install
- Taxonomy Category Icon on index page
- Woocommerce categories displayed on every category and shopping page
- woocommerce product search based only title
- Related post based on 2 categories
- How to insert category name above post title in a featured pages plugin?
- Authenticating custom field on login
- Displaying saved category checked in a plugin?
- WordPress Categories from Plugin
- Showpost and last
- Is it possible to setup Category wise Subsciption?
- How to use categories in the URL with Advanced Custom Fields?
- Filter EVERY category link with my plugin
- Category archive in menu
- 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
- 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
- wp_insert_post_data filter to set category
- 404 not found problem with URL rewrite custom category
- Automatically set posts to NoIndex depending on category?
- formatting the way posts show up
- 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]
- Create WordPress category dynamically
- Can i have limit posts on a specific category and automatically remove older ones?
- Gravity Forms and Gravity View Permissions
- Categories not showing when all of the posts are private
- How to add portfolio category post count in main navigation menu?