Post revisions from mdawaffe. see #6775

git-svn-id: https://develop.svn.wordpress.org/trunk@7747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-04-18 23:38:21 +00:00
parent bfcd9e8fc4
commit c72fd439c6
22 changed files with 2698 additions and 9 deletions
+14 -2
View File
@@ -442,10 +442,15 @@ function get_search_comments_feed_link($search_query = '', $feed = '') {
return $link;
}
function get_edit_post_link( $id = 0 ) {
function get_edit_post_link( $id = 0, $context = 'display' ) {
if ( !$post = &get_post( $id ) )
return;
if ( 'display' == $context )
$action = 'action=edit&';
else
$action = 'action=edit&';
switch ( $post->post_type ) :
case 'page' :
if ( !current_user_can( 'edit_page', $post->ID ) )
@@ -459,6 +464,13 @@ function get_edit_post_link( $id = 0 ) {
$file = 'media';
$var = 'attachment_id';
break;
case 'revision' :
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
$file = 'revision';
$var = 'revision';
$action = '';
break;
default :
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
@@ -467,7 +479,7 @@ function get_edit_post_link( $id = 0 ) {
break;
endswitch;
return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php?action=edit&$var=$post->ID", $post->ID );
return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php?{$action}$var=$post->ID", $post->ID );
}
function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {