diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 39e1891..45e8e05 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -4168,7 +4168,8 @@ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $appe
 	// If $post_categories isn't already an array, make it one:
 	$post_categories = (array) $post_categories;
 	if ( empty( $post_categories ) ) {
-		if ( 'post' == $post_type && 'auto-draft' != $post_status ) {
+		// 'post' and CPT associated with 'category' taxonomy require at least one category.
+		if ( is_object_in_taxonomy( $post_type, 'category' ) && 'auto-draft' != $post_status ) {
 			$post_categories = array( get_option( 'default_category' ) );
 			$append          = false;
 		} else {
diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php
index c0b20bb..a88fbd0 100644
--- a/tests/phpunit/tests/post.php
+++ b/tests/phpunit/tests/post.php
@@ -1354,4 +1354,51 @@ class Tests_Post extends WP_UnitTestCase {
 		$this->assertEquals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
 	}
 
+
+	/**
+	* Test that setting void category for CPT associated with 'category' taxonomy has default category.
+	*
+	* @ticket 43516
+	*/
+	function test_set_post_category_cpt_default_category () {
+		$term = wp_insert_term( 'Foo', 'category' );
+
+		$post_id = wp_insert_post( array( 'post_title' => 'Foo', 'post_category' => array( $term['term_id'] ) ) );
+		$post = get_post( $post_id );
+		$this->assertInternalType( 'array', $post->post_category );
+		$this->assertEquals( $term['term_id'], $post->post_category[0] );
+
+		// Reset categories
+		wp_set_post_categories( $post_id, array() );
+		$this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
+
+		register_post_type( 'cpt', array( 'taxonomies' => array( 'category' ) ) );
+		$post_id = wp_insert_post( array( 'post_title' => 'Foo', 'post_type' => 'cpt', 'post_category' => array( $term['term_id'] ) ) );
+		$post = get_post( $post_id );
+
+		// Reset categories
+		wp_set_post_categories( $post_id, array() );
+		$this->assertInternalType( 'array', $post->post_category );
+		$this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
+	}
+
+
+	/**
+	 * Test that inserting 'post' and CPT associated with 'category' taxonomy has default category.
+	 *
+	 * @ticket 43516
+	 */
+	function test_insert_post_cpt_has_default_category () {
+		$id = wp_insert_post( array( 'post_title' => 'Foo' ) );
+		$post = get_post( $id );
+		$this->assertInternalType( 'array', $post->post_category );
+		$this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
+
+		register_post_type( 'cpt', array( 'taxonomies' => array( 'category' ) ) );
+		$id = wp_insert_post( array( 'post_title' => 'Foo', 'post_type' => 'cpt' ) );
+		$post = get_post( $id );
+		$this->assertInternalType( 'array', $post->post_category );
+		$this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
+
+	}
 }
