Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #59827, comment 16


Ignore:
Timestamp:
11/09/2023 05:54:11 PM (7 months ago)
Author:
jsmoriss
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59827, comment 16

    v1 v2  
    33> It looks like your plugin returns a string for the '_wp_post_revision_field_' . meta_key filter, so it doesn't make sense that it triggers this error
    44
    5 The "'_wp_post_revision_field_' . meta_key" filter is only used for the diff shown to users on the revision page.
     5The "_wp_post_revision_field_{meta_key}" filter is only used for the diff shown to users on the revision page.
    66
    77The problem is the compare done in `wp_save_post_revision()` (see https://github.com/WordPress/wordpress-develop/blob/6.3/src/wp-includes/revision.php#L109) which WordPress uses to determine if a revision needs to be saved - it assumes that all post meta are strings.
     8
     9I didn't actually need to include the "_wp_post_revision_fields" and "_wp_post_revision_field_{meta_key}" filters in the test plugin to create the error - it's just nice to have some visual feedback on the revisions page. :) To trigger the bug, you just need to save the Page with the test plugin active.
    810
    911> ps. it would be good to add a test here to validate any fix we come up with.