Changeset 9170 for trunk/src/bp-groups/bp-groups-notifications.php
- Timestamp:
- 11/24/2014 07:13:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-notifications.php
r9163 r9170 416 416 $group = groups_get_group( array( 'group_id' => $group_id ) ); 417 417 $group_link = bp_get_group_permalink( $group ); 418 $amount = 'single'; 418 419 419 420 // Set up the string and the filter … … 422 423 if ( (int) $total_items > 1 ) { 423 424 $text = sprintf( __( '%1$d new membership requests for the group "%2$s"', 'buddypress' ), (int) $total_items, $group->name ); 424 $ filter = 'bp_groups_multiple_new_membership_requests_notification';425 $amount = 'multiple'; 425 426 $notification_link = $group_link . 'admin/membership-requests/?n=1'; 426 427 427 428 if ( 'string' == $format ) { 428 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link ); 429 } else { 430 return apply_filters( $filter, array( 429 /** 430 * Filters groups multiple new membership request notification for string format. 431 * 432 * This is a dynamic filter that is dependent on item count and action. 433 * Complete filter - bp_groups_multiple_new_membership_requests_notification. 434 * 435 * @since BuddyPress (1.0.0) 436 * 437 * @param string $string HTML anchor tag for request. 438 * @param string $group_link The permalink for the group. 439 * @param int $total_items Total number of membership requests. 440 * @param string $group->name Name of the group. 441 * @param string $text Notification content. 442 * @param string $notification_link The permalink for notification. 443 */ 444 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 ); 445 } else { 446 /** 447 * Filters groups multiple new membership request notification for any non-string format. 448 * 449 * This is a dynamic filter that is dependent on item count and action. 450 * Complete filter - bp_groups_multiple_new_membership_requests_notification. 451 * 452 * @since BuddyPress (1.0.0) 453 * 454 * @param array $array Array holding permalink and content for notification. 455 * @param string $group_link The permalink for the group. 456 * @param int $total_items Total number of membership requests. 457 * @param string $group->name Name of the group. 458 * @param string $text Notification content. 459 * @param string $notification_link The permalink for notification. 460 */ 461 return apply_filters( 'bp_groups_' . $amount . '_' . $action . 's_notification', array( 431 462 'link' => $notification_link, 432 463 'text' => $text … … 436 467 $user_fullname = bp_core_get_user_displayname( $requesting_user_id ); 437 468 $text = sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ); 438 $filter = 'bp_groups_single_new_membership_request_notification';439 469 $notification_link = $group_link . 'admin/membership-requests/?n=1'; 440 470 441 471 if ( 'string' == $format ) { 442 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link ); 443 } else { 444 return apply_filters( $filter, array( 472 /** 473 * Filters groups single new membership request notification for string format. 474 * 475 * This is a dynamic filter that is dependent on item count and action. 476 * Complete filter - bp_groups_single_new_membership_request_notification. 477 * 478 * @since BuddyPress (1.0.0) 479 * 480 * @param string $string HTML anchor tag for request. 481 * @param string $group_link The permalink for the group. 482 * @param string $user_fullname Full name of requesting user. 483 * @param string $group->name Name of the group. 484 * @param string $text Notification content. 485 * @param string $notification_link The permalink for notification. 486 */ 487 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 ); 488 } else { 489 /** 490 * Filters groups single new membership request notification for any non-string format. 491 * 492 * This is a dynamic filter that is dependent on item count and action. 493 * Complete filter - bp_groups_single_new_membership_request_notification. 494 * 495 * @since BuddyPress (1.0.0) 496 * 497 * @param array $array Array holding permalink and content for notification. 498 * @param string $group_link The permalink for the group. 499 * @param string $user_fullname Full name of requesting user. 500 * @param string $group->name Name of the group. 501 * @param string $text Notification content. 502 * @param string $notification_link The permalink for notification. 503 */ 504 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 445 505 'link' => $notification_link, 446 506 'text' => $text … … 456 516 $group = groups_get_group( array( 'group_id' => $group_id ) ); 457 517 $group_link = bp_get_group_permalink( $group ); 518 $amount = 'single'; 458 519 459 520 if ( (int) $total_items > 1 ) { 460 521 $text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int) $total_items, $group->name ); 461 $ filter = 'bp_groups_multiple_membership_request_accepted_notification';522 $amount = 'multiple'; 462 523 $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1'; 463 524 464 525 if ( 'string' == $format ) { 465 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link ); 466 } else { 467 return apply_filters( $filter, array( 526 /** 527 * Filters multiple accepted group membership requests notification for string format. 528 * Complete filter - bp_groups_multiple_membership_request_accepted_notification. 529 * 530 * @since BuddyPress (1.0.0) 531 * 532 * @param string $string HTML anchor tag for notification. 533 * @param int $total_items Total number of accepted requests. 534 * @param string $group->name Name of the group. 535 * @param string $text Notification content. 536 * @param string $notification_link The permalink for notification. 537 */ 538 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link ); 539 } else { 540 /** 541 * Filters multiple accepted group membership requests notification for non-string format. 542 * Complete filter - bp_groups_multiple_membership_request_accepted_notification. 543 * 544 * @since BuddyPress (1.0.0) 545 * 546 * @param array $array Array holding permalink and content for notification 547 * @param int $total_items Total number of accepted requests. 548 * @param string $group->name Name of the group. 549 * @param string $text Notification content. 550 * @param string $notification_link The permalink for notification. 551 */ 552 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 468 553 'link' => $notification_link, 469 554 'text' => $text … … 476 561 477 562 if ( 'string' == $format ) { 478 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 479 } else { 563 /** 564 * Filters single accepted group membership request notification for string format. 565 * Complete filter - bp_groups_single_membership_request_accepted_notification. 566 * 567 * @since BuddyPress (1.0.0) 568 * 569 * @param string $string HTML anchor tag for notification. 570 * @param string $group_link The permalink for the group. 571 * @param string $group->name Name of the group. 572 * @param string $text Notification content. 573 * @param string $notification_link The permalink for notification. 574 */ 575 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 576 } else { 577 /** 578 * Filters single accepted group membership request notification for non-string format. 579 * Complete filter - bp_groups_single_membership_request_accepted_notification. 580 * 581 * @since BuddyPress (1.0.0) 582 * 583 * @param array $array Array holding permalink and content for notification. 584 * @param string $group_link The permalink for the group. 585 * @param string $group->name Name of the group. 586 * @param string $text Notification content. 587 * @param string $notification_link The permalink for notification. 588 */ 480 589 return apply_filters( $filter, array( 481 590 'link' => $notification_link, … … 492 601 $group = groups_get_group( array( 'group_id' => $group_id ) ); 493 602 $group_link = bp_get_group_permalink( $group ); 603 $amount = 'single'; 494 604 495 605 if ( (int) $total_items > 1 ) { 496 606 $text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int) $total_items, $group->name ); 497 $ filter = 'bp_groups_multiple_membership_request_rejected_notification';607 $amount = 'multiple'; 498 608 $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1'; 499 609 500 610 if ( 'string' == $format ) { 501 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name ); 502 } else { 503 return apply_filters( $filter, array( 611 /** 612 * Filters multiple rejected group membership requests notification for string format. 613 * Complete filter - bp_groups_multiple_membership_request_rejected_notification. 614 * 615 * @since BuddyPress (1.0.0) 616 * 617 * @param string $string HTML anchor tag for notification. 618 * @param int $total_items Total number of rejected requests. 619 * @param string $group->name Name of the group. 620 * @param string $text Notification content. 621 * @param string $notification_link The permalink for notification. 622 */ 623 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name ); 624 } else { 625 /** 626 * Filters multiple rejected group membership requests notification for non-string format. 627 * Complete filter - bp_groups_multiple_membership_request_rejected_notification. 628 * 629 * @since BuddyPress (1.0.0) 630 * 631 * @param array $array Array holding permalink and content for notification. 632 * @param int $total_items Total number of rejected requests. 633 * @param string $group->name Name of the group. 634 * @param string $text Notification content. 635 * @param string $notification_link The permalink for notification. 636 */ 637 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 504 638 'link' => $notification_link, 505 639 'text' => $text … … 508 642 } else { 509 643 $text = sprintf( __( 'Membership for group "%s" rejected', 'buddypress' ), $group->name ); 510 $filter = 'bp_groups_single_membership_request_rejected_notification';511 644 $notification_link = $group_link . '?n=1'; 512 645 513 646 if ( 'string' == $format ) { 514 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 515 } else { 516 return apply_filters( $filter, array( 647 /** 648 * Filters single rejected group membership requests notification for string format. 649 * Complete filter - bp_groups_single_membership_request_rejected_notification. 650 * 651 * @since BuddyPress (1.0.0) 652 * 653 * @param string $string HTML anchor tag for notification. 654 * @param int $group_link The permalink for the group. 655 * @param string $group->name Name of the group. 656 * @param string $text Notification content. 657 * @param string $notification_link The permalink for notification. 658 */ 659 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 660 } else { 661 /** 662 * Filters single rejected group membership requests notification for non-string format. 663 * Complete filter - bp_groups_single_membership_request_rejected_notification. 664 * 665 * @since BuddyPress (1.0.0) 666 * 667 * @param array $array Array holding permalink and content for notification. 668 * @param int $group_link The permalink for the group. 669 * @param string $group->name Name of the group. 670 * @param string $text Notification content. 671 * @param string $notification_link The permalink for notification. 672 */ 673 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 517 674 'link' => $notification_link, 518 675 'text' => $text … … 528 685 $group = groups_get_group( array( 'group_id' => $group_id ) ); 529 686 $group_link = bp_get_group_permalink( $group ); 687 $amount = 'single'; 530 688 531 689 if ( (int) $total_items > 1 ) { 532 690 $text = sprintf( __( 'You were promoted to an admin in %d groups', 'buddypress' ), (int) $total_items ); 533 $ filter = 'bp_groups_multiple_member_promoted_to_admin_notification';691 $amount = 'multiple'; 534 692 $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1'; 535 693 536 694 if ( 'string' == $format ) { 537 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 538 } else { 539 return apply_filters( $filter, array( 695 /** 696 * Filters multiple promoted to group admin notification for string format. 697 * Complete filter - bp_groups_multiple_member_promoted_to_admin_notification. 698 * 699 * @since BuddyPress (1.0.0) 700 * 701 * @param string $string HTML anchor tag for notification. 702 * @param int $total_items Total number of rejected requests. 703 * @param string $text Notification content. 704 * @param string $notification_link The permalink for notification. 705 */ 706 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 707 } else { 708 /** 709 * Filters multiple promoted to group admin notification for non-string format. 710 * Complete filter - bp_groups_multiple_member_promoted_to_admin_notification. 711 * 712 * @since BuddyPress (1.0.0) 713 * 714 * @param array $array Array holding permalink and content for notification. 715 * @param int $total_items Total number of rejected requests. 716 * @param string $text Notification content. 717 * @param string $notification_link The permalink for notification. 718 */ 719 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 540 720 'link' => $notification_link, 541 721 'text' => $text … … 544 724 } else { 545 725 $text = sprintf( __( 'You were promoted to an admin in the group "%s"', 'buddypress' ), $group->name ); 546 $filter = 'bp_groups_single_member_promoted_to_admin_notification';547 726 $notification_link = $group_link . '?n=1'; 548 727 549 728 if ( 'string' == $format ) { 550 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 551 } else { 552 return apply_filters( $filter, array( 729 /** 730 * Filters single promoted to group admin notification for non-string format. 731 * Complete filter - bp_groups_single_member_promoted_to_admin_notification. 732 * 733 * @since BuddyPress (1.0.0) 734 * 735 * @param string $string HTML anchor tag for notification. 736 * @param int $group_link The permalink for the group. 737 * @param string $group->name Name of the group. 738 * @param string $text Notification content. 739 * @param string $notification_link The permalink for notification. 740 */ 741 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 742 } else { 743 /** 744 * Filters single promoted to group admin notification for non-string format. 745 * Complete filter - bp_groups_single_member_promoted_to_admin_notification. 746 * 747 * @since BuddyPress (1.0.0) 748 * 749 * @param array $array Array holding permalink and content for notification. 750 * @param int $group_link The permalink for the group. 751 * @param string $group->name Name of the group. 752 * @param string $text Notification content. 753 * @param string $notification_link The permalink for notification. 754 */ 755 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 553 756 'link' => $notification_link, 554 757 'text' => $text … … 564 767 $group = groups_get_group( array( 'group_id' => $group_id ) ); 565 768 $group_link = bp_get_group_permalink( $group ); 769 $amount = 'single'; 566 770 567 771 if ( (int) $total_items > 1 ) { 568 772 $text = sprintf( __( 'You were promoted to a mod in %d groups', 'buddypress' ), (int) $total_items ); 569 $ filter = 'bp_groups_multiple_member_promoted_to_mod_notification';773 $amount = 'multiple'; 570 774 $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1'; 571 775 572 776 if ( 'string' == $format ) { 573 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 574 } else { 575 return apply_filters( $filter, array( 777 /** 778 * Filters multiple promoted to group mod notification for string format. 779 * Complete filter - bp_groups_multiple_member_promoted_to_mod_notification. 780 * 781 * @since BuddyPress (1.0.0) 782 * 783 * @param string $string HTML anchor tag for notification. 784 * @param int $total_items Total number of rejected requests. 785 * @param string $text Notification content. 786 * @param string $notification_link The permalink for notification. 787 */ 788 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 789 } else { 790 /** 791 * Filters multiple promoted to group mod notification for non-string format. 792 * Complete filter - bp_groups_multiple_member_promoted_to_mod_notification. 793 * 794 * @since 1.0.0 795 * 796 * @param array $array Array holding permalink and content for notification. 797 * @param int $total_items Total number of rejected requests. 798 * @param string $text Notification content. 799 * @param string $notification_link The permalink for notification. 800 */ 801 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 576 802 'link' => $notification_link, 577 803 'text' => $text … … 580 806 } else { 581 807 $text = sprintf( __( 'You were promoted to a mod in the group "%s"', 'buddypress' ), $group->name ); 582 $filter = 'bp_groups_single_member_promoted_to_mod_notification';583 808 $notification_link = $group_link . '?n=1'; 584 809 585 810 if ( 'string' == $format ) { 586 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 587 } else { 588 return apply_filters( $filter, array( 811 /** 812 * Filters single promoted to group mod notification for string format. 813 * Complete filter - bp_groups_single_member_promoted_to_mod_notification. 814 * 815 * @since BuddyPress (1.0.0) 816 * 817 * @param string $string HTML anchor tag for notification. 818 * @param int $group_link The permalink for the group. 819 * @param string $group->name Name of the group. 820 * @param string $text Notification content. 821 * @param string $notification_link The permalink for notification. 822 */ 823 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 824 } else { 825 /** 826 * Filters single promoted to group admin notification for non-string format. 827 * Complete filter - bp_groups_single_member_promoted_to_mod_notification. 828 * 829 * @since BuddyPress (1.0.0) 830 * 831 * @param array $array Array holding permalink and content for notification. 832 * @param int $group_link The permalink for the group. 833 * @param string $group->name Name of the group. 834 * @param string $text Notification content. 835 * @param string $notification_link The permalink for notification. 836 */ 837 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 589 838 'link' => $notification_link, 590 839 'text' => $text … … 599 848 $group = groups_get_group( array( 'group_id' => $group_id ) ); 600 849 $group_link = bp_get_group_permalink( $group ); 850 $amount = 'single'; 601 851 602 852 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1'; … … 604 854 if ( (int) $total_items > 1 ) { 605 855 $text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int) $total_items ); 606 $filter = 'bp_groups_multiple_group_invite_notification'; 607 608 if ( 'string' == $format ) { 609 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 610 } else { 611 return apply_filters( $filter, array( 856 $amount = 'multiple'; 857 858 if ( 'string' == $format ) { 859 /** 860 * Filters multiple group invitation notification for string format. 861 * Complete filter - bp_groups_multiple_group_invite_notification. 862 * 863 * @since BuddyPress (1.0.0) 864 * 865 * @param string $string HTML anchor tag for notification. 866 * @param int $total_items Total number of rejected requests. 867 * @param string $text Notification content. 868 * @param string $notification_link The permalink for notification. 869 */ 870 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); 871 } else { 872 /** 873 * Filters multiple group invitation notification for non-string format. 874 * Complete filter - bp_groups_multiple_group_invite_notification. 875 * 876 * @since BuddyPress (1.0.0) 877 * 878 * @param array $array Array holding permalink and content for notification. 879 * @param int $total_items Total number of rejected requests. 880 * @param string $text Notification content. 881 * @param string $notification_link The permalink for notification. 882 */ 883 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 612 884 'link' => $notification_link, 613 885 'text' => $text … … 619 891 620 892 if ( 'string' == $format ) { 621 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 622 } else { 623 return apply_filters( $filter, array( 893 /** 894 * Filters single group invitation notification for string format. 895 * Complete filter - bp_groups_single_group_invite_notification. 896 * 897 * @since BuddyPress (1.0.0) 898 * 899 * @param string $string HTML anchor tag for notification. 900 * @param int $group_link The permalink for the group. 901 * @param string $group->name Name of the group. 902 * @param string $text Notification content. 903 * @param string $notification_link The permalink for notification. 904 */ 905 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); 906 } else { 907 /** 908 * Filters single group invitation notification for non-string format. 909 * Complete filter - bp_groups_single_group_invite_notification. 910 * 911 * @since BuddyPress (1.0.0) 912 * 913 * @param array $array Array holding permalink and content for notification. 914 * @param int $group_link The permalink for the group. 915 * @param string $group->name Name of the group. 916 * @param string $text Notification content. 917 * @param string $notification_link The permalink for notification. 918 */ 919 return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array( 624 920 'link' => $notification_link, 625 921 'text' => $text
Note: See TracChangeset
for help on using the changeset viewer.