Changeset 7747 for trunk/wp-includes/link-template.php
- Timestamp:
- 04/18/2008 11:38:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r7667 r7747 443 443 } 444 444 445 function get_edit_post_link( $id = 0 ) {445 function get_edit_post_link( $id = 0, $context = 'display' ) { 446 446 if ( !$post = &get_post( $id ) ) 447 447 return; 448 449 if ( 'display' == $context ) 450 $action = 'action=edit&'; 451 else 452 $action = 'action=edit&'; 448 453 449 454 switch ( $post->post_type ) : … … 460 465 $var = 'attachment_id'; 461 466 break; 467 case 'revision' : 468 if ( !current_user_can( 'edit_post', $post->ID ) ) 469 return; 470 $file = 'revision'; 471 $var = 'revision'; 472 $action = ''; 473 break; 462 474 default : 463 475 if ( !current_user_can( 'edit_post', $post->ID ) ) … … 468 480 endswitch; 469 481 470 return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php? action=edit&$var=$post->ID", $post->ID );482 return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php?{$action}$var=$post->ID", $post->ID ); 471 483 } 472 484
Note: See TracChangeset
for help on using the changeset viewer.