[wp-trac] [WordPress Trac] #59636: Add meta to the revisions screen

WordPress Trac noreply at wordpress.org
Mon Oct 30 23:40:57 UTC 2023


#59636: Add meta to the revisions screen
-----------------------------+------------------------------
 Reporter:  adamsilverstein  |       Owner:  adamsilverstein
     Type:  enhancement      |      Status:  assigned
 Priority:  normal           |   Milestone:  6.5
Component:  Revisions        |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------------------

Comment (by jsmoriss):

 Note that if anything else than a string is returned by
 `_wp_post_revision_field_{$meta_key}`, then PHP issues an error:

 {{{
 PHP Warning:  trim() expects parameter 1 to be string, array given in
 wordpress/wp-includes/formatting.php on line 5506
 }}}

 Since metadata can contain other types than just strings (like arrays, for
 example), it would be nice if WP could handle those types returned by
 `_wp_post_revision_field_{$meta_key}`.

 Here is an example of an array formatted using print_r() in the revisions
 page:

 [[Image(https://surniaulula.com/wp-
 content/uploads/screenshots/Screen%20Shot%202023-10-30%20at%204.34.00%20PM.png)]]

 And the code I used to hook those filters and format the metadata array:

 https://github.com/surniaulula/wpsso/blob/master/lib/abstract/wp-
 meta.php#L250-L319

 js.

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


More information about the wp-trac mailing list