Changeset 5325
- Timestamp:
- 11/12/2011 09:09:29 PM (13 years ago)
- Location:
- trunk/bp-activity
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-admin.php
r5287 r5325 3 3 * BuddyPress Activity component admin screen 4 4 * 5 * Props to WordPress core for the Comments admin screen and its contextual help text, on which this is heavily based. 5 * Props to WordPress core for the Comments admin screen, and its contextual help text, 6 * on which this implementation is heavily based. 6 7 * 7 8 * @package BuddyPress … … 65 66 * 66 67 * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table 67 * @global WP_Screen $current_screen Current screen object68 68 * @since 1.6 69 69 */ 70 70 function bp_activity_admin_load() { 71 global $bp_activity_list_table , $current_screen;71 global $bp_activity_list_table; 72 72 73 73 // per_page screen option 74 74 add_screen_option( 'per_page', array( 'label' => _x( 'Activities', 'Activity items per page (screen options)', 'buddypress' )) ); 75 75 76 // Help text 77 add_contextual_help( $current_screen, '<p>' . __( 'You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>' . 76 // Help panel - text 77 add_contextual_help( get_current_screen(), '<p>' . __( 'You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>' . 78 '<p>' . __( 'There are many different types of activities. Some are generated by BuddyPress automatically, and others are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>' . 79 78 80 '<p>' . __( 'In the Activity column, above each activity it says “Submitted on,” followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity.', 'buddypress' ) . '</p>' . 79 '<p>' . __( 'There are many different types of activities. Some are generated by BuddyPress automatically, and others are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>' . 81 '<p>' . __( 'In the In Response To column, the text is the name of the user who generated the activity, and a link to the activity on your live site. The small bubble with the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.', 'buddypress' ) . '</p>' 82 ); 83 84 // Help panel - sidebar links 85 get_current_screen()->set_help_sidebar( 80 86 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 81 87 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' … … 85 91 $bp_activity_list_table = new BP_Activity_List_Table(); 86 92 87 // Handle edit/reply/spam/unspam/delete of activities93 // Handle spam/un-spam/delete of activities 88 94 $doaction = $bp_activity_list_table->current_action(); 89 if ( $doaction ) { 90 check_admin_referer( 'bulk-activities' ); 91 95 if ( $doaction && 'edit' != $doaction ) { 96 97 // Build redirection URL 98 $redirect_to = remove_query_arg( array( 'aid', 'deleted', 'spammed', 'unspammed', ), wp_get_referer() ); 99 $redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to ); 100 101 // Get activity IDs 102 $activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] ); 103 104 // Is this a bulk request? 105 if ( 'bulk_' == substr( $doaction, 0, 5 ) && !empty( $_REQUEST['aid'] ) ) { 106 // Check this is a valid form submission 107 check_admin_referer( 'bulk-activities' ); 108 109 // Trim 'bulk_' off the action name to avoid duplicating a ton of code 110 $doaction = substr( $doaction, 5 ); 111 112 // This is a request to delete, spam, or un-spam, a single item. 113 } elseif ( !empty( $_REQUEST['aid'] ) ) { 114 115 // Check this is a valid form submission 116 check_admin_referer( 'spam-activity_' . $activity_ids[0] ); 117 } 118 119 // Initialise counters for how many of each type of item we perform an action on 120 $deleted = $spammed = $unspammed = 0; 121 122 // "We'd like to shoot the monster, could you move, please?" 123 foreach ( $activity_ids as $activity_id ) { 124 // @todo: Check the permissions on each 125 //if ( ! current_user_can( 'bp_edit_activity', $activity_id ) ) 126 // continue; 127 128 // Get the activity from the database 129 $activity = new BP_Activity_Activity( $activity_id ); 130 if ( empty( $activity->component ) ) 131 continue; 132 133 switch ( $doaction ) { 134 case 'delete' : 135 if ( 'activity_comment' == $activity->type ) 136 bp_activity_delete_comment( $activity->item_id, $activity->id ); 137 else 138 bp_activity_delete( array( 'id' => $activity->id ) ); 139 140 $deleted++; 141 break; 142 143 case 'ham' : 144 bp_activity_mark_as_ham( $activity ); 145 $activity->save(); 146 147 break; 148 149 case 'spam' : 150 bp_activity_mark_as_spam( $activity ); 151 $activity->save(); 152 153 $spammed++; 154 break; 155 156 default: 157 break; 158 } 159 160 // Release memory 161 unset( $activity ); 162 } 163 164 // Add arguments to the redirect URL so that on page reload, we can easily display what we've just done. 165 if ( $spammed ) 166 $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to ); 167 168 if ( $unspammed ) 169 $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to ); 170 171 if ( $deleted ) 172 $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to ); 173 174 // Redirect 175 wp_redirect( $redirect_to ); 176 exit; 177 178 // If a referrer and a nonce is supplied, but no action, redirect back. 92 179 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 93 94 180 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); 181 exit; 95 182 } 96 183 } … … 105 192 global $bp_activity_list_table; 106 193 194 $messages = array(); 195 196 // If the user has just made a change to an activity item, build status messages 197 if ( !empty( $_REQUEST['deleted'] ) || !empty( $_REQUEST['spammed'] ) || !empty( $_REQUEST['unspammed'] ) ) { 198 $deleted = !empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; 199 $spammed = !empty( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0; 200 $unspammed = !empty( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0; 201 202 if ( $deleted > 0 ) 203 $messages[] = sprintf( _n( '%s activity was permanently deleted.', '%s activities were permanently deleted.', $deleted, 'buddypress' ), $deleted ); 204 205 if ( $spammed > 0 ) 206 $messages[] = sprintf( _n( '%s activity marked as spam.', '%s activities marked as spam.', $spammed, 'buddypress' ), $spammed ); 207 208 if ( $unspammed > 0 ) 209 $messages[] = sprintf( _n( '%s activity restored from the spam.', '%s activities restored from the spam.', $unspammed, 'buddypress' ), $unspammed ); 210 211 // Handle the edit screen 212 } elseif ( 'edit' == $bp_activity_list_table->current_action() && !empty( $_GET['aid'] ) ) { 213 echo '@TODO: Activity Edit screen.'; 214 return; 215 } 216 217 // Prepare the activity items for display 107 218 $bp_activity_list_table->prepare_items(); 108 219 ?> … … 111 222 <?php screen_icon( 'buddypress' ); ?> 112 223 <h2> 113 <?php if ( !empty( $_REQUEST['a '] ) ) : ?>114 <?php printf( __( 'Activity (ID #%d)', 'buddypress' ), (int) $_REQUEST['a '] ); ?>224 <?php if ( !empty( $_REQUEST['aid'] ) ) : ?> 225 <?php printf( __( 'Activity (ID #%d)', 'buddypress' ), (int) $_REQUEST['aid'] ); ?> 115 226 <?php else : ?> 116 227 <?php _e( 'Activity', 'buddypress' ); ?> … … 121 232 <?php endif; ?> 122 233 </h2> 234 235 <?php // If the user has just made a change to an activity item, display the status messages ?> 236 <?php if ( !empty( $messages ) ) : ?> 237 <div id="moderated" class="updated"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> 238 <?php endif; ?> 123 239 124 240 <?php $bp_activity_list_table->views(); ?> … … 181 297 182 298 // Option defaults 183 $filter = array();184 $ activity= false;185 $search_terms = false;186 $sort = 'DESC';187 $spam = 'ham_only';299 $filter = array(); 300 $include_id = false; 301 $search_terms = false; 302 $sort = 'DESC'; 303 $spam = 'ham_only'; 188 304 189 305 // Set current page … … 216 332 217 333 // Check if user has clicked on a specific activity (if so, fetch only that, and any related, activity). 218 if ( !empty( $_REQUEST['a '] ) )219 $ activity = (int) $_REQUEST['a'];334 if ( !empty( $_REQUEST['aid'] ) ) 335 $include_id = (int) $_REQUEST['aid']; 220 336 221 337 // Get the spam total (ignoring any search query or filter) … … 228 344 unset( $spams ); 229 345 230 // Get the activit es from the database346 // Get the activities from the database 231 347 $activities = bp_activity_get( array( 232 348 'display_comments' => 'stream', 233 349 'filter' => $filter, 234 'in' => $ activity,350 'in' => $include_id, 235 351 'page' => $page, 236 352 'per_page' => $per_page, … … 246 362 $new_activities[] = (array) $activity_item; 247 363 364 // @todo If we're viewing a specific activity, check/merge $activity->children into the main list (recursive). 365 /*if ( $include_id ) { 366 }*/ 367 248 368 // Set raw data to display 249 369 $this->items = $new_activities; … … 307 427 </tfoot> 308 428 309 <tbody id="the-comment-list" class="list:comment">429 <tbody id="the-comment-list"> 310 430 <?php $this->display_rows_or_placeholder(); ?> 311 </tbody>312 313 <tbody id="the-extra-comment-list" class="list:comment" style="display: none;">314 <?php $this->items = $this->extra_items; $this->display_rows(); ?>315 431 </tbody> 316 432 </table> … … 326 442 */ 327 443 function get_views() { 444 $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] ); 328 445 ?> 329 446 <ul class="subsubsub"> 330 <li class="all"><a href="<?php echo remove_query_arg( 'activity_status'); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>331 <li class="spam"><a href="<?php echo add_query_arg( 'activity_status', 'spam' ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam (%d)', 'buddypress' ), $this->spam_count ); ?></a></li>447 <li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li> 448 <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%d)</span>', 'buddypress' ), $this->spam_count ); ?></a></li> 332 449 </ul> 333 450 <?php … … 342 459 function get_bulk_actions() { 343 460 $actions = array(); 344 $actions[' spam'] = __( 'Mark as Spam', 'buddypress' );345 $actions[' unspam']= __( 'Not Spam', 'buddypress' );346 $actions[' delete'] = __( 'Delete Permanently', 'buddypress' );461 $actions['bulk_spam'] = __( 'Mark as Spam', 'buddypress' ); 462 $actions['bulk_ham'] = __( 'Not Spam', 'buddypress' ); 463 $actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' ); 347 464 348 465 return $actions; … … 440 557 */ 441 558 function column_cb( $item ) { 442 printf( '<input type="checkbox" name="a ctivity_id[]" value="%d" />', (int) $item['id'] );559 printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] ); 443 560 } 444 561 … … 478 595 ); 479 596 480 // Get rollover actions. 481 // Reply 597 // Build actions URLs 598 $base_url = network_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); 599 $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) ); 600 601 $delete_url = $base_url . "&action=delete&$spam_nonce"; 602 $edit_url = $base_url . '&action=edit'; 603 $ham_url = $base_url . "&action=ham&$spam_nonce"; 604 $spam_url = $base_url . "&action=spam&$spam_nonce"; 605 606 // Rollover actions 607 608 // Reply - javascript only; implemented by AJAX. 482 609 if ( 'spam' != $item_status ) 483 $actions['reply'] = sprintf( '<a href="%s" >%s</a>', esc_attr( '#' ), __( 'Reply', 'buddypress' ) );610 $actions['reply'] = sprintf( '<a href="%s" class="reply hide-if-no-js">%s</a>', $base_url, __( 'Reply', 'buddypress' ) ); 484 611 485 612 // Edit 486 $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_attr( '#' ), __( 'Edit', 'buddypress' ) );613 $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) ); 487 614 488 615 // Spam/unspam 489 616 if ( 'spam' == $item_status ) 490 $actions['unspam'] = sprintf( '<a href="%s">%s</a>', esc_attr( '#' ), __( 'Not Spam', 'buddypress' ) );617 $actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) ); 491 618 else 492 $actions['spam'] = sprintf( '<a href="%s">%s</a>', esc_attr( '#' ), __( 'Spam', 'buddypress' ) );619 $actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) ); 493 620 494 621 // Delete 495 $actions['delete'] = sprintf( '<a href="%s" >%s</a>', esc_attr( '#' ), __( 'Delete Permanently', 'buddypress' ) );622 $actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) ); 496 623 497 624 // Start timestamp … … 507 634 echo '</div>'; 508 635 509 // Get activity item content 510 $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) ); 636 // Get activity content - if not set, use the action 637 if ( !empty( $item['content'] ) ) 638 $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) ); 639 else 640 $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) ); 511 641 512 642 echo $content . ' ' . $this->row_actions( $actions ); … … 521 651 */ 522 652 function column_response( $item ) { 523 // Does this activity have a parent? 524 if ( empty( $item['secondary_item_id'] ) ) 653 // Display link to user's profile 654 echo bp_core_get_userlink( $item['user_id'] ); 655 656 // Get activity permalink 657 $activity_link = bp_activity_get_permalink( $item['id'], (object) $item ); 658 659 // Get the root activity ID by parsing the permalink; this may be not be the same as $item['id'] for nested items (e.g. activity_comments) 660 $root_activity_id = array(); 661 preg_match( '/\/p\/(\d+)\/*$/i', $activity_link, $root_activity_id ); 662 if ( empty( $root_activity_id[1] ) ) 525 663 return; 526 664 527 /* translators: 1: activity admin screen permalink, 2: activity ID */ 528 printf( __( '<a href="%1$s">Activity ID #%2$d</a>', 'buddypress' ), network_admin_url( 'admin.php?page=bp-activity&a=' . $item['secondary_item_id'] ), $item['secondary_item_id'] ); 665 $root_activity_id = (int) $root_activity_id[1]; 666 667 // Is $item the root activity? 668 if ( (int) $item['id'] == $root_activity_id ) { 669 $root_activity = (object) $item; 670 671 // Get root activity comment count 672 $comment_count = !empty( $root_activity->children ) ? bp_activity_recurse_comment_count( $root_activity ) : 0; 673 674 // Display a link to the root activity's permalink, with its comment count in a speech bubble 675 printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>', network_admin_url( 'admin.php?page=bp-activity&aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count ); 676 677 // $item is not the root activity (it is probably an activity_comment). 678 } else { 679 echo '<br />'; 680 681 // @todo Get comment count from a specific node ($root_activity_id) in the tree, not $root_activity_id's root. 682 } 683 684 // Link to the activity permalink 685 printf( __( '<a href="%1$s">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) ); 529 686 } 530 687 }?> -
trunk/bp-activity/bp-activity-akismet.php
r5284 r5325 76 76 if ( !$user_result || $user_result == $akismet_result ) { 77 77 // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same 78 if ( $akismet_result == 'true'&& $activity['is_spam'] )78 if ( 'true' == $akismet_result && $activity['is_spam'] ) 79 79 $desc = __( 'Flagged as spam by Akismet', 'buddypress' ); 80 80 81 elseif ( $akismet_result == 'false'&& !$activity['is_spam'] )81 elseif ( 'false' == $akismet_result && !$activity['is_spam'] ) 82 82 $desc = __( 'Cleared by Akismet', 'buddypress' ); 83 83 … … 85 85 $who = bp_activity_get_meta( $activity['id'], '_bp_akismet_user' ); 86 86 87 if ( $user_result == 'true')87 if ( 'true' == $user_result ) 88 88 $desc = sprintf( __( 'Flagged as spam by %s', 'buddypress' ), $who ); 89 89 else … … 97 97 $b[ $k ] = $item; 98 98 if ( $k == 'edit' ) 99 $b['history'] = '<a href=" #"> '. __( 'History', 'buddypress' ) . '</a>';99 $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#history"> '. __( 'History', 'buddypress' ) . '</a>'; 100 100 } 101 101 … … 104 104 105 105 if ( $desc ) 106 echo '<span class="akismet-status"><a href=" #">' . htmlspecialchars( $desc ) . '</a></span>';106 echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#history">' . htmlspecialchars( $desc ) . '</a></span>'; 107 107 108 108 return apply_filters( 'bp_akismet_comment_row_action', $actions ); … … 240 240 * 241 241 * @param BP_Activity_Activity $activity 242 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).242 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed). 243 243 * @since 1.6 244 244 */ 245 245 public function mark_as_ham( $activity, $source ) { 246 //DJPAULTODO: Run bp_activity_at_name_filter() somehow... but not twice, if we can help it. Maybe check if it was auto-spammed by Akismet? 246 // If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped. 247 if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) ) 248 $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id ); 247 249 248 250 do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source ); … … 333 335 * Update activity meta after a manual spam change (user initiated) 334 336 * 335 * @global object $bp BuddyPress global settings336 337 * @param BP_Activity_Activity $activity The activity to check 337 338 * @since 1.6 338 339 */ 339 340 public function update_activity_spam_meta( $activity ) { 340 global $bp;341 342 341 // By default, only handle activity updates and activity comments. 343 342 if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) 344 343 return; 345 344 346 $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as spam', 'buddypress' ), $bp->loggedin_user->fullname), 'report-spam' );345 $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as spam', 'buddypress' ), bp_get_loggedin_user_fullname() ), 'report-spam' ); 347 346 bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'true' ); 348 bp_activity_update_meta( $activity->id, '_bp_akismet_user', $bp->loggedin_user->fullname);347 bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_fullname() ); 349 348 } 350 349 … … 352 351 * Update activity meta after a manual ham change (user initiated) 353 352 * 354 * @global object $bp BuddyPress global settings355 353 * @param BP_Activity_Activity $activity The activity to check 356 354 * @since 1.6 357 355 */ 358 356 public function update_activity_ham_meta( $activity ) { 359 global $bp;360 361 357 // By default, only handle activity updates and activity comments. 362 358 if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) 363 359 return; 364 360 365 $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as not spam', 'buddypress' ), $bp->loggedin_user->fullname), 'report-ham' );361 $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as not spam', 'buddypress' ), bp_get_loggedin_user_fullname() ), 'report-ham' ); 366 362 bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'false' ); 367 bp_activity_update_meta( $activity->id, '_bp_akismet_user', $bp->loggedin_user->fullname);363 bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_fullname() ); 368 364 } 369 365 … … 492 488 493 489 // Unique User Agent 494 $akismet_ua = 'BuddyPress/' . constant( 'BP_VERSION') . ' | Akismet/'. constant( 'AKISMET_VERSION' );490 $akismet_ua = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' ); 495 491 496 492 // Use specific IP (if provided) -
trunk/bp-activity/bp-activity-functions.php
r5307 r5325 1360 1360 // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity 1361 1361 if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { 1362 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 1, 1 );1362 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 ); 1363 1363 1364 1364 // Build data package for Akismet … … 1396 1396 // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity 1397 1397 if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { 1398 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 1, 1 );1398 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 ); 1399 1399 1400 1400 // Build data package for Akismet … … 1408 1408 } 1409 1409 1410 //DJPAULTODO: Run bp_activity_at_name_filter() somehow... but not twice, if we can help it. Maybe check if it was auto-spammed by Akismet?1411 1410 do_action( 'bp_activity_mark_as_ham', $activity, $source ); 1412 1411 }
Note: See TracChangeset
for help on using the changeset viewer.