Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 46379)
+++ src/wp-includes/post.php	(working copy)
@@ -6800,9 +6800,9 @@
 	}
 
 	if ( get_option( 'default_pingback_flag' ) ) {
-		add_post_meta( $post_id, '_pingme', '1' );
+		add_post_meta( $post_id, '_pingme', '1', true );
 	}
-	add_post_meta( $post_id, '_encloseme', '1' );
+	add_post_meta( $post_id, '_encloseme', '1', true );
 
 	$to_ping = get_to_ping( $post_id );
 	if ( ! empty( $to_ping ) ) {
Index: tests/phpunit/tests/post.php
===================================================================
--- tests/phpunit/tests/post.php	(revision 46379)
+++ tests/phpunit/tests/post.php	(working copy)
@@ -1430,4 +1430,22 @@
 		$post = get_post( $post_id );
 		self::assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date_gmt ), 'The dates should be equal', 2 );
 	}
+
+	/**
+	 * @ticket 48014
+	 */
+	public function test_publish_post_hook() {
+		$post_id = self::factory()->post->create();
+
+		$enclosed = get_post_meta( $post_id, '_encloseme' );
+
+		$post  = get_post( $post_id );
+		$post1 = wp_update_post( $post );
+
+		$enclosed1 = get_post_meta( $post_id, '_encloseme' );
+
+		$this->assertEquals( '1', count( $enclosed ) );
+		$this->assertEquals( '1', count( $enclosed1 ) );
+
+	}
 }
