X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..85ad385665744d9cc3bcd939906309be7268edb3:/wp-admin/includes/revision.php diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index 597ec1f0..737c3b16 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -1,6 +1,6 @@ $name ) { + /** + * Contextually filter a post revision field. + * + * The dynamic portion of the hook name, $field, corresponds to each of the post + * fields of the revision object being iterated over in a foreach statement. + * + * @since 3.6.0 + * + * @param string $compare_from->$field The current revision field to compare to or from. + * @param string $field The current revision field. + * @param WP_Post $compare_from The revision post object to compare to or from. + * @param string null The context of whether the current revision is the old or the new one. Values are 'to' or 'from'. + */ $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : ''; + + /** This filter is documented in wp-admin/includes/revision.php */ $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' ); $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) ); @@ -85,9 +100,9 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) { * * @since 3.6.0 * - * @param object $post The post object. - * @param int $selected_revision_id The selected revision id. - * @param int $from (optional) The revision id to compare from. + * @param object|int $post The post object. Also accepts a post ID. + * @param int $selected_revision_id The selected revision ID. + * @param int $from Optional. The revision ID to compare from. * * @return array An associative array of revision data and related settings. */