Ticket #21031: 21031.2.patch
| File 21031.2.patch, 3.4 KB (added by , 14 years ago) |
|---|
-
wp-admin/includes/class-wp-comments-list-table.php
413 413 414 414 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { 415 415 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; 416 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>'; 417 $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>'; 416 417 if ( !empty( $post ) ) { 418 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>'; 419 $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>'; 420 } 418 421 } 419 422 420 423 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment ); … … 478 481 function column_response( $comment ) { 479 482 global $post; 480 483 484 if ( empty( $post ) ) 485 return; 486 481 487 if ( isset( $this->pending_count[$post->ID] ) ) { 482 488 $pending_comments = $this->pending_count[$post->ID]; 483 489 } else { -
wp-includes/capabilities.php
961 961 case 'delete_post': 962 962 case 'delete_page': 963 963 $author_data = get_userdata( $user_id ); 964 $post = get_post( $args[0] );965 964 965 if ( ! $post = get_post( $args[0] ) ) 966 break; 967 966 968 if ( 'revision' == $post->post_type ) { 967 969 $post = get_post( $post->post_parent ); 968 970 } … … 1011 1013 case 'edit_post': 1012 1014 case 'edit_page': 1013 1015 $author_data = get_userdata( $user_id ); 1014 $post = get_post( $args[0] );1015 1016 1017 if ( ! $post = get_post( $args[0] ) ) 1018 break; 1019 1016 1020 if ( 'revision' == $post->post_type ) { 1017 1021 $post = get_post( $post->post_parent ); 1018 1022 } … … 1060 1064 case 'read_post': 1061 1065 case 'read_page': 1062 1066 $author_data = get_userdata( $user_id ); 1063 $post = get_post( $args[0] );1064 1067 1068 if ( ! $post = get_post( $args[0] ) ) 1069 break; 1070 1065 1071 if ( 'revision' == $post->post_type ) { 1066 1072 $post = get_post( $post->post_parent ); 1067 1073 } … … 1099 1105 case 'edit_post_meta': 1100 1106 case 'delete_post_meta': 1101 1107 case 'add_post_meta': 1102 $post = get_post( $args[0] ); 1108 1109 if ( ! $post = get_post( $args[0] ) ) 1110 break; 1111 1103 1112 $post_type_object = get_post_type_object( $post->post_type ); 1104 1113 $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID ); 1105 1114 … … 1115 1124 break; 1116 1125 case 'edit_comment': 1117 1126 $comment = get_comment( $args[0] ); 1118 $post = get_post( $comment->comment_post_ID ); 1127 1128 if ( ! $post = get_post( $comment->comment_post_ID ) ) 1129 break; 1130 1119 1131 $post_type_object = get_post_type_object( $post->post_type ); 1120 1132 1121 1133 $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID );