Changes between Initial Version and Version 1 of Ticket #11515, comment 18
- Timestamp:
- 03/15/2013 11:40:46 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11515, comment 18
initial v1 18 18 #!php 19 19 20 // How it's currently done: 20 /** 21 * How it's currently done 22 */ 21 23 // See: http://core.trac.wordpress.org/browser/trunk/wp-admin/comment.php#L96 22 24 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) { … … 25 27 } 26 28 27 //How it could be done: 29 // Error handling in edit-comment.php 30 if ( isset( $_REQUEST['error'] ) ) { 31 $error = (int) $_REQUEST['error']; 32 $error_msg = ''; 33 switch ( $error ) { 34 case 1 : 35 $error_msg = __( 'Oops, no comment with this ID.' ); 36 break; 37 case 2 : 38 $error_msg = __( 'You are not allowed to edit comments on this post.' ); 39 break; 40 } 41 if ( $error_msg ) 42 add_admin_notice( 'moderated', $error_msg ); 43 } 44 45 46 /** 47 * How it could be done: 48 */ 28 49 // No error handling in edit-comments.php necessary. 29 50 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {