Changeset 15596 for trunk/wp-includes/link-template.php
- Timestamp:
- 09/07/2010 11:35:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r15590 r15596 876 876 function get_edit_comment_link( $comment_id = 0 ) { 877 877 $comment = &get_comment( $comment_id ); 878 $post = &get_post( $comment->comment_post_ID ); 879 880 if ( $post->post_type == 'page' ) { 881 if ( !current_user_can( 'edit_page', $post->ID ) ) 882 return; 883 } else { 884 if ( !current_user_can( 'edit_post', $post->ID ) ) 885 return; 886 } 878 879 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) 880 return; 887 881 888 882 $location = admin_url('comment.php?action=editcomment&c=') . $comment->comment_ID; … … 901 895 */ 902 896 function edit_comment_link( $link = null, $before = '', $after = '' ) { 903 global $comment, $post; 904 905 if ( $post->post_type == 'page' ) { 906 if ( !current_user_can( 'edit_page', $post->ID ) ) 907 return; 908 } else { 909 if ( !current_user_can( 'edit_post', $post->ID ) ) 910 return; 911 } 897 global $comment; 898 899 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) 900 return; 912 901 913 902 if ( null === $link )
Note: See TracChangeset
for help on using the changeset viewer.