[wp-trac] [WordPress Trac] #13382: _wp_post_revision_fields filter is not very useful

WordPress Trac noreply at wordpress.org
Thu Oct 8 01:17:22 UTC 2015


#13382: _wp_post_revision_fields filter is not very useful
-------------------------+------------------------------
 Reporter:  mdawaffe     |       Owner:  adamsilverstein
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.4
Component:  Revisions    |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+------------------------------

Comment (by SergeyBiryukov):

 Before [34917], we only passed the post data to
 `_wp_post_revision_fields()` in two places:

 * [source:tags/4.3.1/src/wp-admin/includes/post.php?marks=1635#L1609
 wp_create_post_autosave()]
 * [source:tags/4.3.1/src/wp-includes/revision.php?marks=270#L248
 _wp_put_post_revision()]

 As far as I can see, not passing the post in all other instances was
 intentional, because the [source:trunk/src/wp-
 includes/revision.php?rev=34917&marks=64,65#L29 condition in line 64] is
 never satisfied now.

 [attachment:13382.2.diff] just passes `$post` to the filter as is. The
 filter would still only once though, as per the ticket description.

 Perhaps a new filter for the return value of the function should be
 introduced?

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


More information about the wp-trac mailing list