Changeset 11828 for sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php
- Timestamp:
- 05/10/2022 11:25:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php
r11816 r11828 42 42 43 43 // Disable default BP activity features 44 add_filter( 'bp_activity_can_comment', '__return_false' );45 add_filter( 'bp_activity_do_mentions', '__return_false' );46 add_filter( 'bp_activity_use_akismet', '__return_false' );44 add_filter( 'bp_activity_can_comment', '__return_false' ); 45 add_filter( 'bp_activity_do_mentions', '__return_false' ); 46 add_filter( 'bp_activity_use_akismet', '__return_false' ); 47 47 } 48 48 … … 50 50 * Gets a user by either login, slug, or id. 51 51 * 52 * @param string|int $username The user's login, slug, or id. 52 * @param string|int $username The user's login, slug, or id. 53 * 53 54 * @return WP_User|false WP_User object on success, false on failure. 54 55 */ … … 78 79 * than the ones for BuddyPress.org. 79 80 * 80 * @param array $tables The default tables. 81 * @param array $tables The default tables. 82 * 81 83 * @return array 82 84 */ … … 94 96 * than the ones for BuddyPress.org. 95 97 * 96 * @param array $tables The default meta table. 98 * @param array $tables The default meta table. 99 * 97 100 * @return array 98 101 */ … … 108 111 * Ensures that the activity component is activated. 109 112 * 110 * @param array $activated Array of activated components. 113 * @param array $activated Array of activated components. 114 * 111 115 * @return array 112 116 */ … … 301 305 $required_args[] = 'message'; 302 306 $required_args[] = 'url'; 303 $required_args = array_merge( $required_args, array( 'title', 'site', 'message', 'url' ) );307 $required_args = array_merge( $required_args, array( 'title', 'site', 'message', 'url' ) ); 304 308 } 305 309 if ( in_array( $type, array( 'forum_topic_create', 'forum_topic_remove' ) ) ) { … … 327 331 'secondary_item_id' => intval( $_POST['forum_id'] ), 328 332 ); 329 $activity_id = bp_activity_get_activity_id( $args );333 $activity_id = bp_activity_get_activity_id( $args ); 330 334 $activity_obj = $activity_id ? new BP_Activity_Activity( $activity_id ) : false; 331 335 … … 347 351 esc_html( $_POST['site'] ) 348 352 ); 349 } 350 // Action message for reply creation.351 else {353 354 } else { 355 // Action message for reply creation. 352 356 $action = sprintf( 353 357 'Posted a <a href="%s">reply</a> to <i>%s</i>, on the site %s', … … 371 375 372 376 return bp_activity_add( $args ); 373 } 374 // Remove activity related to a topic or reply.375 elseif ( in_array( $type, array( 'forum_topic_remove', 'forum_reply_remove' ) ) ) {377 378 } elseif ( in_array( $type, array( 'forum_topic_remove', 'forum_reply_remove' ) ) ) { 379 // Remove activity related to a topic or reply. 376 380 if ( ! $activity_obj ) { 377 381 return '-1 Activity not previously reported.'; … … 493 497 */ 494 498 private function handle_trac_activity() { 495 $args = array();496 497 499 $user = $this->get_user( $_POST['user'] ); 498 500 … … 555 557 foreach ( $usernames as $username ) { 556 558 $user = $this->get_user( $username ); 557 if ( empty( $user ) ) continue; 559 if ( empty( $user ) ) { 560 continue; 561 } 558 562 $args = array( 559 563 'user_id' => $user->ID, … … 638 642 } 639 643 } elseif ( 'attendee_checked_in' == $_POST['activity_type'] ) { 640 $type = 'wordcamp_attendee_checked_in';644 $type = 'wordcamp_attendee_checked_in'; 641 645 $order = absint( $_POST['checked_in_count'] ); 642 646 … … 663 667 'item_id' => intval( $item_id ), 664 668 'secondary_item_id' => intval( $_POST['wordcamp_id'] ), 665 'hide_sitewide' => false 669 'hide_sitewide' => false, 666 670 ); 667 671 … … 736 740 'item_id' => intval( $item_id ), 737 741 'secondary_item_id' => false, 738 'hide_sitewide' => false 742 'hide_sitewide' => false, 739 743 ); 740 744
Note: See TracChangeset
for help on using the changeset viewer.