Changeset 9352 for trunk/src/bp-notifications/bp-notifications-template.php
- Timestamp:
- 01/13/2015 01:35:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/bp-notifications-template.php
r9351 r9352 27 27 */ 28 28 function bp_get_notifications_slug() { 29 30 /** 31 * Filters the notifications component slug. 32 * 33 * @since BuddyPress (1.9.0) 34 * 35 * @param string $slug Notifications component slug. 36 */ 29 37 return apply_filters( 'bp_get_notifications_slug', buddypress()->notifications->slug ); 30 38 } … … 47 55 function bp_get_notifications_permalink() { 48 56 $retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() ); 57 58 /** 59 * Filters the notifications permalink. 60 * 61 * @since BuddyPress (1.9.0) 62 * 63 * @param string $retval Permalink for the notifications. 64 */ 49 65 return apply_filters( 'bp_get_notifications_permalink', $retval ); 50 66 } … … 67 83 function bp_get_notifications_unread_permalink() { 68 84 $retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() . '/unread' ); 85 86 /** 87 * Filters the unread notifications permalink. 88 * 89 * @since BuddyPress (1.9.0) 90 * 91 * @param string $retval Permalink for the unread notifications. 92 */ 69 93 return apply_filters( 'bp_get_notifications_unread_permalink', $retval ); 70 94 } … … 87 111 function bp_get_notifications_read_permalink() { 88 112 $retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() . '/read' ); 113 114 /** 115 * Filters the read notifications permalink. 116 * 117 * @since BuddyPress (1.9.0) 118 * 119 * @param string $retval Permalink for the read notifications. 120 */ 89 121 return apply_filters( 'bp_get_notifications_unread_permalink', $retval ); 90 122 } … … 390 422 391 423 } elseif ( $this->current_notification + 1 == $this->notification_count ) { 424 425 /** 426 * Fires right before the rewinding of notification posts. 427 * 428 * @since BuddyPress (1.9.0) 429 */ 392 430 do_action( 'notifications_loop_end'); 393 431 … … 416 454 // loop has just started 417 455 if ( 0 === $this->current_notification ) { 456 457 /** 458 * Fires if the current notification item is the first in the notification loop. 459 * 460 * @since BuddyPress (1.9.0) 461 */ 418 462 do_action( 'notifications_loop_start' ); 419 463 } … … 490 534 buddypress()->notifications->query_loop = $query_loop; 491 535 536 /** 537 * Filters whether or not the user has notifications to display. 538 * 539 * @since BuddyPress (1.9.0) 540 * 541 * @param bool $value Whether or not there are notifications to display. 542 * @param BP_Notifications_Template $query_loop BP_Notifications_Template object instance. 543 */ 492 544 return apply_filters( 'bp_has_notifications', $query_loop->has_notifications(), $query_loop ); 493 545 } … … 533 585 */ 534 586 function bp_get_the_notification_id() { 587 588 /** 589 * Filters the ID of the notification currently being iterated on. 590 * 591 * @since BuddyPress (1.9.0) 592 * 593 * @param int $id ID of the notification being iterated on. 594 */ 535 595 return apply_filters( 'bp_get_the_notification_id', buddypress()->notifications->query_loop->notification->id ); 536 596 } … … 552 612 */ 553 613 function bp_get_the_notification_item_id() { 614 615 /** 616 * Filters the associated item ID of the notification currently being iterated on. 617 * 618 * @since BuddyPress (1.9.0) 619 * 620 * @param int $item_id ID of the associated item. 621 */ 554 622 return apply_filters( 'bp_get_the_notification_item_id', buddypress()->notifications->query_loop->notification->item_id ); 555 623 } … … 571 639 */ 572 640 function bp_get_the_notification_secondary_item_id() { 641 642 /** 643 * Filters the secondary associated item ID of the notification currently being iterated on. 644 * 645 * @since BuddyPress (1.9.0) 646 * 647 * @param int $secondary_item_id ID of the secondary associated item. 648 */ 573 649 return apply_filters( 'bp_get_the_notification_secondary_item_id', buddypress()->notifications->query_loop->notification->secondary_item_id ); 574 650 } … … 590 666 */ 591 667 function bp_get_the_notification_component_name() { 668 669 /** 670 * Filters the name of the component associated with the notification currently being iterated on. 671 * 672 * @since BuddyPress (1.9.0) 673 * 674 * @param int $component_name Name of the component associated with the current notification. 675 */ 592 676 return apply_filters( 'bp_get_the_notification_component_name', buddypress()->notifications->query_loop->notification->component_name ); 593 677 } … … 609 693 */ 610 694 function bp_get_the_notification_component_action() { 695 696 /** 697 * Filters the name of the action associated with the notification currently being iterated on. 698 * 699 * @since BuddyPress (1.9.0) 700 * 701 * @param int $component_action Name of the action associated with the current notification. 702 */ 611 703 return apply_filters( 'bp_get_the_notification_component_action', buddypress()->notifications->query_loop->notification->component_action ); 612 704 } … … 628 720 */ 629 721 function bp_get_the_notification_date_notified() { 722 723 /** 724 * Filters the timestamp of the current notification. 725 * 726 * @since BuddyPress (1.9.0) 727 * 728 * @param string $date_notified Timestamp of the current notification. 729 */ 630 730 return apply_filters( 'bp_get_the_notification_date_notified', buddypress()->notifications->query_loop->notification->date_notified ); 631 731 } … … 660 760 } 661 761 762 /** 763 * Filters the time since value of the current notification. 764 * 765 * @since BuddyPress (1.9.0) 766 * 767 * @param string $retval Time since value for current notification. 768 */ 662 769 return apply_filters( 'bp_get_the_notification_time_since', $retval ); 663 770 } … … 693 800 // Allow non BuddyPress components to hook in 694 801 } else { 802 803 /** This filter is documented in bp-notifications/bp-notifications-functions.php */ 695 804 $description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 ) ); 696 805 } 697 806 698 // Filter and return 807 /** 808 * Filters the full-text description for a specific notification. 809 * 810 * @since BuddyPress (1.9.0) 811 * 812 * @param string $description Full-text description for a specific notification. 813 */ 699 814 return apply_filters( 'bp_get_the_notification_description', $description ); 700 815 } … … 724 839 <?php $retval = ob_get_clean(); 725 840 841 /** 842 * Filters the mark read link for the current notification. 843 * 844 * @since BuddyPress (1.9.0) 845 * 846 * @param string $retval HTML for the mark read link for the current notification. 847 */ 726 848 return apply_filters( 'bp_get_the_notification_mark_read_link', $retval ); 727 849 } … … 761 883 $url = wp_nonce_url( $url, 'bp_notification_mark_read_' . $id ); 762 884 763 // Filter and return 885 /** 886 * Filters the URL used for marking a single notification as read. 887 * 888 * @since BuddyPress (2.1.0) 889 * 890 * @param string $url URL to use for marking the single notification as read. 891 */ 764 892 return apply_filters( 'bp_get_the_notification_mark_read_url', $url ); 765 893 } 766 894 767 895 /** 768 * Output the mark read link for the current notification.896 * Output the mark unread link for the current notification. 769 897 * 770 898 * @since BuddyPress (1.9.0) … … 776 904 } 777 905 /** 778 * Return the mark read link for the current notification.906 * Return the mark unread link for the current notification. 779 907 * 780 908 * @since BuddyPress (1.9.0) … … 789 917 <?php $retval = ob_get_clean(); 790 918 919 /** 920 * Filters the link used for marking a single notification as unread. 921 * 922 * @since BuddyPress (1.9.0) 923 * 924 * @param string $retval HTML for the mark unread link for the current notification. 925 */ 791 926 return apply_filters( 'bp_get_the_notification_mark_unread_link', $retval ); 792 927 } … … 826 961 $url = wp_nonce_url( $url, 'bp_notification_mark_unread_' . $id ); 827 962 828 // Filter and return 963 /** 964 * Filters the URL used for marking a single notification as unread. 965 * 966 * @since BuddyPress (2.1.0) 967 * 968 * @param string $url URL to use for marking the single notification as unread. 969 */ 829 970 return apply_filters( 'bp_get_the_notification_mark_unread_url', $url ); 830 971 } … … 853 994 } 854 995 996 /** 997 * Filters the mark link for the current notification. 998 * 999 * @since BuddyPress (1.9.0) 1000 * 1001 * @param string $retval The mark link for the current notification. 1002 */ 855 1003 return apply_filters( 'bp_get_the_notification_mark_link', $retval ); 856 1004 } … … 880 1028 <?php $retval = ob_get_clean(); 881 1029 1030 /** 1031 * Filters the delete link for the current notification. 1032 * 1033 * @since BuddyPress (1.9.0) 1034 * 1035 * @param string $retval HTML for the delete link for the current notification. 1036 */ 882 1037 return apply_filters( 'bp_get_the_notification_delete_link', $retval ); 883 1038 } … … 927 1082 $url = wp_nonce_url( $url, 'bp_notification_delete_' . $id ); 928 1083 929 // Filter and return 1084 /** 1085 * Filters the URL used for deleting a single notification. 1086 * 1087 * @since BuddyPress (2.1.0) 1088 * 1089 * @param string $url URL used for deleting a single notification. 1090 */ 930 1091 return apply_filters( 'bp_get_the_notification_delete_url', $url ); 931 1092 } … … 969 1130 $retval = $r['before'] . implode( $r['links'], $r['sep'] ) . $r['after']; 970 1131 1132 /** 1133 * Filters the action links for the current notification. 1134 * 1135 * @since BuddyPress (1.9.0) 1136 * 1137 * @param string $retval HTML links for actions to take on single notifications. 1138 */ 971 1139 return apply_filters( 'bp_get_the_notification_action_links', $retval ); 972 1140 } … … 995 1163 $pag = sprintf( _n( 'Viewing 1 notification', 'Viewing %1$s - %2$s of %3$s notifications', $total, 'buddypress' ), $from_num, $to_num, $total ); 996 1164 1165 /** 1166 * Filters the pagination count for the current notification loop. 1167 * 1168 * @since BuddyPress (1.9.0) 1169 * 1170 * @param string $pag HTML for the pagination count. 1171 */ 997 1172 return apply_filters( 'bp_notifications_pagination_count', $pag ); 998 1173 } … … 1014 1189 */ 1015 1190 function bp_get_notifications_pagination_links() { 1191 1192 /** 1193 * Filters the pagination links for the current notification loop. 1194 * 1195 * @since BuddyPress (1.9.0) 1196 * 1197 * @param string $pag_links HTML for the pagination links. 1198 */ 1016 1199 return apply_filters( 'bp_get_notifications_pagination_links', buddypress()->notifications->query_loop->pag_links ); 1017 1200 }
Note: See TracChangeset
for help on using the changeset viewer.