Changeset 5328 for trunk/wp-includes/link-template.php
- Timestamp:
- 04/27/2007 03:51:36 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/link-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r5302 r5328 297 297 function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { 298 298 global $post; 299 299 300 if ( $post->post_type == 'attachment' ) 301 return; 302 elseif ( $post->post_type == 'page' ) { 303 if ( !current_user_can( 'edit_page', $post->ID ) ) 304 return; 305 306 $file = 'page'; 307 } else { 308 if ( !current_user_can( 'edit_post', $post->ID ) ) 309 return; 310 311 $file = 'post'; 312 } 313 300 314 $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . __( 'Edit post' ) . '">' . $link . '</a>'; 301 315 echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; … … 320 334 321 335 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { 322 global $comment; 323 336 global $comment, $post; 337 338 if ( $post->post_type == 'attachment' ) 339 return; 340 elseif ( $post->post_type == 'page' ) 341 if ( !current_user_can( 'edit_page', $post->ID ) ) 342 return; 343 else 344 if ( !current_user_can( 'edit_post', $post->ID ) ) 345 return; 346 324 347 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 325 348 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)