[wp-trac] [WordPress Trac] #58763: Inconsistent add/get/update/delete_post_meta() functions leads to deleting post metadata.

WordPress Trac noreply at wordpress.org
Sat Jun 7 12:20:30 UTC 2025


#58763: Inconsistent add/get/update/delete_post_meta() functions leads to deleting
post metadata.
-------------------------------------------------+-------------------------
 Reporter:  jsmoriss                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  General                              |     Version:
 Severity:  major                                |  Resolution:
 Keywords:  has-patch has-test-info has-unit-    |     Focuses:
  tests early dev-feedback                       |
-------------------------------------------------+-------------------------

Comment (by sandeepdahiya):

 == Test Report
 === Description
 ✅ This report validates that the indicated patch works as expected.

 Patch tested: [https://github.com/WordPress/wordpress-
 develop/pull/5476.diff Patch-5476.diff]

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Firefox 139.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins:
   * Post Meta Logger
   * Test Reports 1.2.0

 === Actual Results
 1. I used code mentioned
 [https://core.trac.wordpress.org/ticket/58763#comment:6 here] by @jsmoriss
 .

 2. Before applying the patch, the PHP log results are:

 {{{
 [07-Jun-2025 11:52:05 UTC] 16 post _test_metadata = OK (value should
 always be "OK" )
 [07-Jun-2025 11:52:05 UTC] 17 revision _test_metadata =  (post metadata
 value now erased)
 [07-Jun-2025 11:52:41 UTC] 16 post _test_metadata =  (value should always
 be "OK" )
 [07-Jun-2025 11:52:41 UTC] 16 post resetting test (by deleting
 _test_metadata)
 [07-Jun-2025 11:52:41 UTC] 18 revision _test_metadata =  (post metadata
 value now erased)
 }}}

 3. After applying the patch, the ✅ Issue resolved with patch and the PHP
 log results are:

 {{{
 [07-Jun-2025 12:06:07 UTC] 10 post _test_metadata = OK (value should
 always be "OK" )
 [07-Jun-2025 12:06:53 UTC] 10 post _test_metadata = OK (value should
 always be "OK" )
 [07-Jun-2025 12:06:53 UTC] 11 revision _test_metadata = OK (post metadata
 value now erased)
 [07-Jun-2025 12:07:19 UTC] 10 post _test_metadata = OK (value should
 always be "OK" )
 [07-Jun-2025 12:07:20 UTC] 12 revision _test_metadata = OK (post metadata
 value now erased)
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58763#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list