Make WordPress Core

Ticket #25283: 25283.diff

File 25283.diff, 1.4 KB (added by DrewAPicture, 12 years ago)

_wp_post_revision_field_$field filter hooks

  • src/wp-admin/includes/revision.php

     
    5555        $return = array();
    5656
    5757        foreach ( _wp_post_revision_fields() as $field => $name ) {
     58                /**
     59                 * Contextually filter a post revision field.
     60                 *
     61                 * The $field at the end of the filter hook corresponds to each of the post
     62                 * fields of the revision object being iterated over in a foreach statement.
     63                 * The dynamic filter hook name means all revision post field are filterable
     64                 * via this hook in this context.
     65                 *
     66                 * @since 3.6.0
     67                 *
     68                 * @param string  $compare_from->$field The current revision field to compare to or from.
     69                 * @param string  $field                The current revision field.
     70                 * @param WP_Post $compare_from         The revision post object to compare to or from.
     71                 * @param string  null                  The context of whether the current revision is the old or the new one. Values are 'to' or 'from'.
     72                 */
    5873                $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : '';
     74
     75                //duplicate_hook
    5976                $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' );
    6077
    6178                $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) );