Revisions: add a 'wp_prepare_revision_for_js'
filter.
Props jtsternberg, adamsilverstein. Fixes #28627. git-svn-id: https://develop.svn.wordpress.org/trunk@34541 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4b83b005d2
commit
c8f167629d
@ -199,7 +199,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
|
|||||||
$current_id = $revision->ID;
|
$current_id = $revision->ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revisions[ $revision->ID ] = array(
|
$revisions_data = array(
|
||||||
'id' => $revision->ID,
|
'id' => $revision->ID,
|
||||||
'title' => get_the_title( $post->ID ),
|
'title' => get_the_title( $post->ID ),
|
||||||
'author' => $authors[ $revision->post_author ],
|
'author' => $authors[ $revision->post_author ],
|
||||||
@ -210,6 +210,16 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
|
|||||||
'current' => $current,
|
'current' => $current,
|
||||||
'restoreUrl' => $can_restore ? $restore_link : false,
|
'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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user