From 8a8e6557d0e502fc4afe173a627b2b6ccfb669af Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 25 Sep 2015 14:04:24 +0000 Subject: [PATCH] Revisions: add a `'wp_prepare_revision_for_js'` filter. Props jtsternberg, adamsilverstein. Fixes #28627. Built from https://develop.svn.wordpress.org/trunk@34541 git-svn-id: http://core.svn.wordpress.org/trunk@34505 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/revision.php | 12 +++++++++++- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index 67bb56c761..756a1dd500 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -199,7 +199,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null $current_id = $revision->ID; } - $revisions[ $revision->ID ] = array( + $revisions_data = array( 'id' => $revision->ID, 'title' => get_the_title( $post->ID ), 'author' => $authors[ $revision->post_author ], @@ -210,6 +210,16 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null 'current' => $current, 'restoreUrl' => $can_restore ? $restore_link : false, ); + + /** + * Filter the array of revisions used on the revisions screen. + * + * @since 4.4.0 + * + * @param array $revisions_data The bootstrapped data for the revisions screen. + * @param WP_Post $post The revision's parent WP_Post object. + */ + $revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $post ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index fd9b5ad3ac..8d7b9ea251 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34540'; +$wp_version = '4.4-alpha-34541'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.