Changeset 9489 for trunk/src/bp-groups/bp-groups-notifications.php
- Timestamp:
- 02/17/2015 05:44:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-notifications.php
r9351 r9489 91 91 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 92 92 93 /* Send the message */ 93 /** 94 * Filters the user email that the group update notification will be sent to. 95 * 96 * @since BuddyPress (1.2.0) 97 * 98 * @param string $to User email the notification is being sent to. 99 */ 94 100 $to = apply_filters( 'groups_notification_group_updated_to', $to ); 101 102 /** 103 * Filters the group update notification subject that will be sent to user. 104 * 105 * @since BuddyPress (1.2.0) 106 * 107 * @param string $subject Email notification subject text. 108 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 109 */ 95 110 $subject = apply_filters_ref_array( 'groups_notification_group_updated_subject', array( $subject, &$group ) ); 111 112 /** 113 * Filters the group update notification message that will be sent to user. 114 * 115 * @since BuddyPress (1.2.0) 116 * 117 * @param string $message Email notification message text. 118 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 119 * @param string $group_link URL permalink to the group that was updated. 120 * @param string $settings_link URL permalink for the user's notification settings area. 121 */ 96 122 $message = apply_filters_ref_array( 'groups_notification_group_updated_message', array( $message, &$group, $group_link, $settings_link ) ); 97 123 … … 101 127 } 102 128 129 /** 130 * Fires after the notification is sent that a group has been updated. 131 * 132 * See https://buddypress.trac.wordpress.org/ticket/3644 for blank message parameter. 133 * 134 * @since BuddyPress (1.5.0) 135 * 136 * @param array $user_ids Array of user IDs to notify about the update. 137 * @param string $subject Email notification subject text. 138 * @param string $value Empty string preventing PHP error. 139 * @param int $group_id ID of the group that was updated. 140 */ 103 141 do_action( 'bp_groups_sent_updated_email', $user_ids, $subject, '', $group_id ); 104 142 } … … 192 230 } 193 231 194 // Send the message 232 /** 233 * Filters the user email that the group membership request will be sent to. 234 * 235 * @since BuddyPress (1.2.0) 236 * 237 * @param string $to User email the request is being sent to. 238 */ 195 239 $to = apply_filters( 'groups_notification_new_membership_request_to', $to ); 240 241 /** 242 * Filters the group membership request subject that will be sent to user. 243 * 244 * @since BuddyPress (1.2.0) 245 * 246 * @param string $subject Membership request email subject text. 247 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 248 */ 196 249 $subject = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $subject, &$group ) ); 250 251 /** 252 * Filters the group membership request message that will be sent to user. 253 * 254 * @since BuddyPress (1.2.0) 255 * 256 * @param string $message Membership request email message text. 257 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 258 * @param string $requesting_user_name Username of who is requesting membership. 259 * @param string $profile_link URL permalink for the profile for the user requesting membership. 260 * @param string $group_requests URL permalink for the group requests screen for group being requested membership to. 261 * @param string $settings_link URL permalink for the user's notification settings area. 262 */ 197 263 $message = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) ); 198 264 199 265 wp_mail( $to, $subject, $message ); 200 266 267 /** 268 * Fires after the notification is sent that a member has requested group membership. 269 * 270 * @since BuddyPress (1.5.0) 271 * 272 * @param int $admin_id ID of the group administrator. 273 * @param string $subject Email notification subject text. 274 * @param string $message Email notification message text. 275 * @param int $requesting_user_id ID of the user requesting membership. 276 * @param int $group_id ID of the group receiving membership request. 277 * @param int $membership_id ID of the group membership object. 278 */ 201 279 do_action( 'bp_groups_sent_membership_request_email', $admin_id, $subject, $message, $requesting_user_id, $group_id, $membership_id ); 202 280 } … … 270 348 } 271 349 272 // Send the message 350 /** 351 * Filters the user email that the group membership request result will be sent to. 352 * 353 * @since BuddyPress (1.2.0) 354 * 355 * @param string $to User email the request result is being sent to. 356 */ 273 357 $to = apply_filters( 'groups_notification_membership_request_completed_to', $to ); 358 359 /** 360 * Filters the group membership request result subject that will be sent to user. 361 * 362 * @since BuddyPress (1.2.0) 363 * 364 * @param string $subject Membership request result email subject text. 365 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 366 */ 274 367 $subject = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $subject, &$group ) ); 368 369 /** 370 * Filters the group membership request result message that will be sent to user. 371 * 372 * @since BuddyPress (1.2.0) 373 * 374 * @param string $message Membership request result email message text. 375 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 376 * @param string $group_link URL permalink for the group that was requested membership for. 377 * @param string $settings_link URL permalink for the user's notification settings area. 378 */ 275 379 $message = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $message, &$group, $group_link, $settings_link ) ); 276 380 277 381 wp_mail( $to, $subject, $message ); 278 382 383 /** 384 * Fires after the notification is sent that a membership has been approved. 385 * 386 * @since BuddyPress (1.5.0) 387 * 388 * @param int $requesting_user_id ID of the user whose membership was approved. 389 * @param string $subject Email notification subject text. 390 * @param string $message Email notification message text. 391 * @param int $group_id ID of the group that was joined. 392 */ 279 393 do_action( 'bp_groups_sent_membership_approved_email', $requesting_user_id, $subject, $message, $group_id ); 280 394 } … … 339 453 } 340 454 341 // Send the message 455 /** 456 * Filters the user email that the group promotion notification will be sent to. 457 * 458 * @since BuddyPress (1.2.0) 459 * 460 * @param string $to User email the promotion notification is being sent to. 461 */ 342 462 $to = apply_filters( 'groups_notification_promoted_member_to', $to ); 463 464 /** 465 * Filters the group promotion notification subject that will be sent to user. 466 * 467 * @since BuddyPress (1.2.0) 468 * 469 * @param string $subject Promotion notification email subject text. 470 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 471 */ 343 472 $subject = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $subject, &$group ) ); 473 474 /** 475 * Filters the group promotion notification message that will be sent to user. 476 * 477 * @since BuddyPress (1.2.0) 478 * 479 * @param string $message Promotion notification email message text. 480 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 481 * @param string $promoted_to Role that the user was promoted to within the group. 482 * @param string $group_link URL permalink for the group that the promotion was related to. 483 * @param string $settings_link URL permalink for the user's notification settings area. 484 */ 344 485 $message = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $message, &$group, $promoted_to, $group_link, $settings_link ) ); 345 486 346 487 wp_mail( $to, $subject, $message ); 347 488 489 /** 490 * Fires after the notification is sent that a member has been promoted. 491 * 492 * @since BuddyPress (1.5.0) 493 * 494 * @param int $user_id ID of the user who was promoted. 495 * @param string $subject Email notification subject text. 496 * @param string $message Email notification message text. 497 * @param int $group_id ID of the group that the user is a member of. 498 */ 348 499 do_action( 'bp_groups_sent_promoted_email', $user_id, $subject, $message, $group_id ); 349 500 } … … 417 568 } 418 569 419 // Send the message 570 /** 571 * Filters the user email that the group invite notification will be sent to. 572 * 573 * @since BuddyPress (1.2.0) 574 * 575 * @param string $to User email the invite notification is being sent to. 576 */ 420 577 $to = apply_filters( 'groups_notification_group_invites_to', $to ); 578 579 /** 580 * Filters the group invite notification subject that will be sent to user. 581 * 582 * @since BuddyPress (1.2.0) 583 * 584 * @param string $subject Invite notification email subject text. 585 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 586 */ 421 587 $subject = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $subject, &$group ) ); 588 589 /** 590 * Filters the group invite notification message that will be sent to user. 591 * 592 * @since BuddyPress (1.2.0) 593 * 594 * @param string $message Invite notification email message text. 595 * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. 596 * @param string $inviter_name Username for the person doing the inviting. 597 * @param string $inviter_link Profile link for the person doing the inviting. 598 * @param string $invites_link URL permalink for the invited user's invite management screen. 599 * @param string $group_link URL permalink for the group that the invite was related to. 600 * @param string $settings_link URL permalink for the user's notification settings area. 601 */ 422 602 $message = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) ); 423 603 424 604 wp_mail( $to, $subject, $message ); 425 605 606 /** 607 * Fires after the notification is sent that a member has been invited to a group. 608 * 609 * @since BuddyPress (1.5.0) 610 * 611 * @param int $invited_user_id ID of the user who was invited. 612 * @param string $subject Email notification subject text. 613 * @param string $message Email notification message text. 614 * @param BP_Groups_Group $group Group object. 615 */ 426 616 do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group ); 427 617 } … … 463 653 464 654 if ( 'string' == $format ) { 655 465 656 /** 466 657 * Filters groups multiple new membership request notification for string format. … … 480 671 return apply_filters( 'bp_groups_' . $amount . '_' . $action . 's_notification', '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link ); 481 672 } else { 673 482 674 /** 483 675 * Filters groups multiple new membership request notification for any non-string format. … … 506 698 507 699 if ( 'string' == $format ) { 700 508 701 /** 509 702 * Filters groups single new membership request notification for string format. … … 523 716 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link ); 524 717 } else { 718 525 719 /** 526 720 * Filters groups single new membership request notification for any non-string format. … … 560 754 561 755 if ( 'string' == $format ) { 756 562 757 /** 563 758 * Filters multiple accepted group membership requests notification for string format. … … 574 769 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link ); 575 770 } else { 771 576 772 /** 577 773 * Filters multiple accepted group membership requests notification for non-string format. … … 597 793 598 794 if ( 'string' == $format ) { 795 599 796 /** 600 797 * Filters single accepted group membership request notification for string format. … … 611 808 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 612 809 } else { 810 613 811 /** 614 812 * Filters single accepted group membership request notification for non-string format. … … 645 843 646 844 if ( 'string' == $format ) { 845 647 846 /** 648 847 * Filters multiple rejected group membership requests notification for string format. … … 659 858 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name ); 660 859 } else { 860 661 861 /** 662 862 * Filters multiple rejected group membership requests notification for non-string format. … … 681 881 682 882 if ( 'string' == $format ) { 883 683 884 /** 684 885 * Filters single rejected group membership requests notification for string format. … … 695 896 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 696 897 } else { 898 697 899 /** 698 900 * Filters single rejected group membership requests notification for non-string format. … … 701 903 * @since BuddyPress (1.0.0) 702 904 * 703 * @param array $array 905 * @param array $array Array holding permalink and content for notification. 704 906 * @param int $group_link The permalink for the group. 705 907 * @param string $group->name Name of the group. … … 963 1165 } 964 1166 1167 /** 1168 * Fires right before returning the formatted group notifications. 1169 * 1170 * @since BuddyPress (1.0.0) 1171 * 1172 * @param string $action The type of notification being rendered. 1173 * @param int $item_id The primary item ID. 1174 * @param int $secondary_item_id The secondary item ID. 1175 * @param int $total_items Total amount of items to format. 1176 */ 965 1177 do_action( 'groups_format_notifications', $action, $item_id, $secondary_item_id, $total_items ); 966 1178
Note: See TracChangeset
for help on using the changeset viewer.