Changeset 815233
- Timestamp:
- 12/05/2013 04:25:44 AM (12 years ago)
- Location:
- advanced-comments-moderation/trunk
- Files:
-
- 2 edited
-
advanced-comments-moderation.php (modified) (8 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-comments-moderation/trunk/advanced-comments-moderation.php
r807903 r815233 4 4 Plugin URI: http://www.leavingworkbehind.com 5 5 Description: Advanced Comments Moderation makes managing your WordPress blog's comments far easier. 6 Version: 1. 26 Version: 1.3 7 7 Author: Tom Ewer and Tito Pandu 8 8 Author URI: http://www.leavingworkbehind.com … … 90 90 add_action( 'admin_enqueue_scripts', array( $this, 'admin_stylesheets' ) ); 91 91 92 93 94 if ( isset( $_GET['advanced_comments_moderation'] ) ) { 95 96 $this->comments_dismissed = implode( ',', $this->comments_dismissed() ); 97 $this->comments_has_replied = implode( ',', $this->comments_has_replied() ); 98 $this->comments_from_author = implode( ',', $this->comments_from_author() ); 99 100 if ( $this->options['have_replied'] ) { 101 add_filter( 102 'comments_clauses', 103 array( $this, 'get_comments_missing_replies_and_not_dismissed' ), 10, 2 104 ); 105 106 add_filter( 107 'comment_row_actions', 108 array( $this, 'add_dismiss_to_comment_row' ), 10, 2 109 ); 110 } 111 112 if ( $this->options['authors_comments'] ) { 113 add_filter( 114 'comments_clauses', 115 array( $this, 'get_comment_list_except_by_author' ), 10, 2 116 ); 117 } 118 119 if ( $this->options['show_pingbacks'] ) { 120 add_filter( 121 'comments_clauses', array( $this, 'except_pingback_and_trackback' ), 10, 2 122 ); 123 } 124 125 // add_action( 'pre_get_comments', array( $this, 'return_not_replied_list' ) ); 92 if ( isset( $_GET['advanced_comments_moderation'] ) ) { 93 94 $this->comments_dismissed = implode( ',', $this->comments_dismissed() ); 95 $this->comments_has_replied = implode( ',', $this->comments_has_replied() ); 96 $this->comments_from_author = implode( ',', $this->comments_from_author() ); 97 98 if ( $this->options['have_replied'] ) { 99 add_filter( 100 'comments_clauses', 101 array( $this, 'get_comments_missing_replies_and_not_dismissed' ), 10, 2 102 ); 103 104 add_filter( 105 'comment_row_actions', 106 array( $this, 'add_dismiss_to_comment_row' ), 10, 2 107 ); 126 108 } 127 109 128 add_filter( 'comment_status_links', array( $this, 'get_list_dismissed_comments' ) ); 129 add_filter( 'comment_status_links', array( $this, 'get_list_comments_has_not_replied' ) ); 110 if ( $this->options['authors_comments'] ) { 111 add_filter( 112 'comments_clauses', 113 array( $this, 'get_comment_list_except_by_author' ), 10, 2 114 ); 115 } 116 117 if ( $this->options['show_pingbacks'] ) { 118 add_filter( 119 'comments_clauses', array( $this, 'except_pingback_and_trackback' ), 10, 2 120 ); 121 } 122 123 // add_action( 'pre_get_comments', array( $this, 'return_not_replied_list' ) ); 124 } 125 126 add_filter( 'comment_status_links', array( $this, 'get_list_dismissed_comments' ) ); 127 add_filter( 'comment_status_links', array( $this, 'get_list_comments_has_not_replied' ) ); 130 128 131 129 if ( isset( $_GET['dismissed_comment'] ) ) { … … 228 226 return; 229 227 230 if ( $comm_email == $this->get_post_author_email( $comm_post_id ) ) { 228 if ( 229 $this->comment_is_by_post_author( $comment_id ) 230 ) { 231 231 update_comment_meta( $comm_parent, '_acm_has_replied', 1 ); 232 232 } … … 252 252 return; 253 253 254 if ( $comm_email == $this->get_post_author_email( $comm_post_id ) ) { 254 if ( 255 $this->comment_is_by_post_author( $comment_id ) 256 ) { 255 257 update_comment_meta( $comm_parent, '_acm_has_replied', 0 ); 256 258 } … … 272 274 $comm_post_auth = $comm_post_obj->post_author; 273 275 274 if ( $comm_email == $this->get_post_author_email( $comm_post_id ) ) { 276 if ( 277 $this->comment_is_by_post_author( $comment_id ) 278 ) { 275 279 update_comment_meta( $comm_post_id, '_acm_is_author', 1 ); 276 280 } else { … … 561 565 $post = get_post( $comment->comment_post_ID ); 562 566 563 return $comment->comment_author_email == $this->get_post_author_email( $post->ID ); 567 return $comment->comment_author_email == $this->get_post_author_email( $post->ID ) || 568 in_array( $comment->comment_author_email, $this->options['hide_authors'] ); 564 569 565 570 } // end if … … 930 935 'Hide pingbacks', // The text used to label the field 931 936 'acm_pingbacks_display', // The callback function used to render the field 937 'discussion', // The page on which we'll be rendering this field 938 'acm_section' // The section to which we're adding the setting 939 ); 940 941 add_settings_field( 942 'acm_hide_authors', // The ID (or the name) of the field 943 'Hide specified authors', // The text used to label the field 944 'acm_hide_authors_display', // The callback function used to render the field 932 945 'discussion', // The page on which we'll be rendering this field 933 946 'acm_section' // The section to which we're adding the setting … … 992 1005 <?php 993 1006 } // end acm_pingbacks_display 1007 1008 function acm_hide_authors_display() { 1009 // Read the options for the hide_authors section 1010 $options = (array)get_option( 'acm_options' ); 1011 $hide_authors = $options['hide_authors']; 1012 $authors = new WP_User_Query( array( 'who' => 'authors' ) ); 1013 1014 if ( ! empty( $authors ) ) { ?> 1015 <ul class="author-list" style="padding: 0; margin-top: 0;"> 1016 <?php 1017 // echo var_dump($hide_authors); 1018 foreach ($authors->results as $author) { 1019 $is_checked = ''; 1020 if ( in_array( $author->user_email, $hide_authors ) ) { 1021 $is_checked = 'checked="checked"'; 1022 } 1023 ?> 1024 <li> 1025 <label for="acm_options[hide_authors][<?php echo $author->user_email ?>]"> 1026 <input type="checkbox" name="acm_options[hide_authors][]" id="acm_options[hide_authors][<?php echo $author->user_email ?>]" value="<?php echo $author->user_email; ?>" <?php echo $is_checked; ?> /> 1027 <?php echo $author->user_login . " (" . $author->user_nicename . ")"; ?> 1028 </label> 1029 </li> 1030 <?php 1031 } 1032 ?> 1033 </ul> 1034 <?php 1035 } 1036 } // end acm_hide_authors_display 994 1037 995 1038 class ACM_Custom_Bulk_Action { -
advanced-comments-moderation/trunk/readme.txt
r807903 r815233 6 6 Requires at least: 3.5 7 7 Tested up to: 3.7.1 8 Stable tag: 1. 28 Stable tag: 1.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Upgrade Notice == 53 53 54 = 1.3 = 55 * Add force option for certain author. 56 54 57 = 1.2 = 55 58 * Fix problem for different table prefix. … … 64 67 == Changelog == 65 68 69 = 1.3= 70 * Add force option for certain author. 71 66 72 = 1.2 = 67 73 * Fix problem for different table prefix.
Note: See TracChangeset
for help on using the changeset viewer.