- Timestamp:
- 09/24/2015 11:55:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/bp-notifications-template.php
r10079 r10138 1 1 <?php 2 3 2 /** 4 3 * BuddyPress Notifications Template Functions. … … 8 7 */ 9 8 10 // Exit if accessed directly 9 // Exit if accessed directly. 11 10 defined( 'ABSPATH' ) || exit; 12 11 … … 14 13 * Output the notifications component slug. 15 14 * 16 * @since BuddyPress (1.9.0)15 * @since 1.9.0 17 16 */ 18 17 function bp_notifications_slug() { … … 22 21 * Return the notifications component slug. 23 22 * 24 * @since BuddyPress (1.9.0)23 * @since 1.9.0 25 24 * 26 25 * @return string Slug of the Notifications component. … … 31 30 * Filters the notifications component slug. 32 31 * 33 * @since BuddyPress (1.9.0)32 * @since 1.9.0 34 33 * 35 34 * @param string $slug Notifications component slug. … … 41 40 * Output the notifications permalink. 42 41 * 43 * @since BuddyPress (1.9.0)42 * @since 1.9.0 44 43 */ 45 44 function bp_notifications_permalink() { … … 49 48 * Return the notifications permalink. 50 49 * 51 * @since BuddyPress (1.9.0)50 * @since 1.9.0 52 51 * 53 52 * @return string Notifications permalink. … … 59 58 * Filters the notifications permalink. 60 59 * 61 * @since BuddyPress (1.9.0)60 * @since 1.9.0 62 61 * 63 62 * @param string $retval Permalink for the notifications. … … 69 68 * Output the unread notifications permalink. 70 69 * 71 * @since BuddyPress (1.9.0)70 * @since 1.9.0 72 71 */ 73 72 function bp_notifications_unread_permalink() { … … 77 76 * Return the unread notifications permalink. 78 77 * 79 * @since BuddyPress (1.9.0)78 * @since 1.9.0 80 79 * 81 80 * @return string Unread notifications permalink. … … 87 86 * Filters the unread notifications permalink. 88 87 * 89 * @since BuddyPress (1.9.0)88 * @since 1.9.0 90 89 * 91 90 * @param string $retval Permalink for the unread notifications. … … 97 96 * Output the read notifications permalink. 98 97 * 99 * @since BuddyPress (1.9.0)98 * @since 1.9.0 100 99 */ 101 100 function bp_notifications_read_permalink() { … … 105 104 * Return the read notifications permalink. 106 105 * 107 * @since BuddyPress (1.9.0)106 * @since 1.9.0 108 107 * 109 108 * @return string Read notifications permalink. … … 115 114 * Filters the read notifications permalink. 116 115 * 117 * @since BuddyPress (1.9.0)116 * @since 1.9.0 118 117 * 119 118 * @param string $retval Permalink for the read notifications. … … 129 128 * Responsible for loading a group of notifications into a loop for display. 130 129 * 131 * @since BuddyPress (1.9.0)130 * @since 1.9.0 132 131 */ 133 132 class BP_Notifications_Template { … … 136 135 * The loop iterator. 137 136 * 138 * @since BuddyPress (1.9.0)137 * @since 1.9.0 139 138 * @access public 140 139 * @var int … … 145 144 * The number of notifications returned by the paged query. 146 145 * 147 * @since BuddyPress (1.9.0)146 * @since 1.9.0 148 147 * @access public 149 148 * @var int … … 154 153 * Total number of notifications matching the query. 155 154 * 156 * @since BuddyPress (1.9.0)155 * @since 1.9.0 157 156 * @access public 158 157 * @var int … … 163 162 * Array of notifications located by the query. 164 163 * 165 * @since BuddyPress (1.9.0)164 * @since 1.9.0 166 165 * @access public 167 166 * @var array … … 172 171 * The notification object currently being iterated on. 173 172 * 174 * @since BuddyPress (1.9.0)173 * @since 1.9.0 175 174 * @access public 176 175 * @var object … … 181 180 * A flag for whether the loop is currently being iterated. 182 181 * 183 * @since BuddyPress (1.9.0)182 * @since 1.9.0 184 183 * @access public 185 184 * @var bool … … 190 189 * The ID of the user to whom the displayed notifications belong. 191 190 * 192 * @since BuddyPress (1.9.0)191 * @since 1.9.0 193 192 * @access public 194 193 * @var int … … 199 198 * The page number being requested. 200 199 * 201 * @since BuddyPress (1.9.0)200 * @since 1.9.0 202 201 * @access public 203 202 * @var int … … 208 207 * The $_GET argument used in URLs for determining pagination. 209 208 * 210 * @since BuddyPress (1.9.0)209 * @since 1.9.0 211 210 * @access public 212 211 * @var int … … 217 216 * The number of items to display per page of results. 218 217 * 219 * @since BuddyPress (1.9.0)218 * @since 1.9.0 220 219 * @access public 221 220 * @var int … … 226 225 * An HTML string containing pagination links. 227 226 * 228 * @since BuddyPress (1.9.0)227 * @since 1.9.0 229 228 * @access public 230 229 * @var string … … 235 234 * A string to match against. 236 235 * 237 * @since BuddyPress (1.9.0)236 * @since 1.9.0 238 237 * @access public 239 238 * @var string … … 244 243 * A database column to order the results by. 245 244 * 246 * @since BuddyPress (1.9.0)245 * @since 1.9.0 247 246 * @access public 248 247 * @var string … … 253 252 * The direction to sort the results (ASC or DESC). 254 253 * 255 * @since BuddyPress (1.9.0)254 * @since 1.9.0 256 255 * @access public 257 256 * @var string … … 262 261 * Array of variables used in this notification query. 263 262 * 264 * @since BuddyPress (2.2.2)263 * @since 2.2.2 265 264 * @var array 266 265 */ … … 272 271 * @see bp_has_notifications() For information on the array format. 273 272 * 274 * @since BuddyPress (1.9.0)273 * @since 1.9.0 275 274 * 276 275 * @param array $args { … … 378 377 * Whether there are notifications available in the loop. 379 378 * 380 * @since BuddyPress (1.9.0)379 * @since 1.9.0 381 380 * 382 381 * @see bp_has_notifications() … … 395 394 * Set up the next notification and iterate index. 396 395 * 397 * @since BuddyPress (1.9.0)396 * @since 1.9.0 398 397 * 399 398 * @return object The next notification to iterate over. … … 411 410 * Rewind the blogs and reset blog index. 412 411 * 413 * @since BuddyPress (1.9.0)412 * @since 1.9.0 414 413 */ 415 414 public function rewind_notifications() { … … 429 428 * while ( bp_notifications() ) { ... 430 429 * 431 * @since BuddyPress (1.9.0)430 * @since 1.9.0 432 431 * 433 432 * @see bp_notifications() … … 446 445 * Fires right before the rewinding of notification posts. 447 446 * 448 * @since BuddyPress (1.9.0)447 * @since 1.9.0 449 448 */ 450 449 do_action( 'notifications_loop_end'); … … 464 463 * that iteration make reference to the current notification. 465 464 * 466 * @since BuddyPress (1.9.0)465 * @since 1.9.0 467 466 * 468 467 * @see bp_the_notification() … … 478 477 * Fires if the current notification item is the first in the notification loop. 479 478 * 480 * @since BuddyPress (1.9.0)479 * @since 1.9.0 481 480 */ 482 481 do_action( 'notifications_loop_start' ); … … 494 493 * templates and template functions to display a list of notifications. 495 494 * 496 * @since BuddyPress (1.9.0)495 * @since 1.9.0 497 496 * 498 497 * @param array|string $args { … … 561 560 * Filters whether or not the user has notifications to display. 562 561 * 563 * @since BuddyPress (1.9.0)562 * @since 1.9.0 564 563 * 565 564 * @param bool $value Whether or not there are notifications to display. … … 572 571 * Get the notifications returned by the template loop. 573 572 * 574 * @since BuddyPress (1.9.0)573 * @since 1.9.0 575 574 * 576 575 * @return array List of notifications. … … 583 582 * Get the current notification object in the loop. 584 583 * 585 * @since BuddyPress (1.9.0)584 * @since 1.9.0 586 585 * 587 586 * @return object The current notification within the loop. … … 596 595 * Output the ID of the notification currently being iterated on. 597 596 * 598 * @since BuddyPress (1.9.0)597 * @since 1.9.0 599 598 */ 600 599 function bp_the_notification_id() { … … 604 603 * Return the ID of the notification currently being iterated on. 605 604 * 606 * @since BuddyPress (1.9.0)605 * @since 1.9.0 607 606 * 608 607 * @return int ID of the current notification. … … 613 612 * Filters the ID of the notification currently being iterated on. 614 613 * 615 * @since BuddyPress (1.9.0)614 * @since 1.9.0 616 615 * 617 616 * @param int $id ID of the notification being iterated on. … … 623 622 * Output the associated item ID of the notification currently being iterated on. 624 623 * 625 * @since BuddyPress (1.9.0)624 * @since 1.9.0 626 625 */ 627 626 function bp_the_notification_item_id() { … … 631 630 * Return the associated item ID of the notification currently being iterated on. 632 631 * 633 * @since BuddyPress (1.9.0)632 * @since 1.9.0 634 633 * 635 634 * @return int ID of the item associated with the current notification. … … 640 639 * Filters the associated item ID of the notification currently being iterated on. 641 640 * 642 * @since BuddyPress (1.9.0)641 * @since 1.9.0 643 642 * 644 643 * @param int $item_id ID of the associated item. … … 650 649 * Output the secondary associated item ID of the notification currently being iterated on. 651 650 * 652 * @since BuddyPress (1.9.0)651 * @since 1.9.0 653 652 */ 654 653 function bp_the_notification_secondary_item_id() { … … 658 657 * Return the secondary associated item ID of the notification currently being iterated on. 659 658 * 660 * @since BuddyPress (1.9.0)659 * @since 1.9.0 661 660 * 662 661 * @return int ID of the secondary item associated with the current notification. … … 667 666 * Filters the secondary associated item ID of the notification currently being iterated on. 668 667 * 669 * @since BuddyPress (1.9.0)668 * @since 1.9.0 670 669 * 671 670 * @param int $secondary_item_id ID of the secondary associated item. … … 677 676 * Output the name of the component associated with the notification currently being iterated on. 678 677 * 679 * @since BuddyPress (1.9.0)678 * @since 1.9.0 680 679 */ 681 680 function bp_the_notification_component_name() { … … 685 684 * Return the name of the component associated with the notification currently being iterated on. 686 685 * 687 * @since BuddyPress (1.9.0)686 * @since 1.9.0 688 687 * 689 688 * @return int Name of the component associated with the current notification. … … 694 693 * Filters the name of the component associated with the notification currently being iterated on. 695 694 * 696 * @since BuddyPress (1.9.0)695 * @since 1.9.0 697 696 * 698 697 * @param int $component_name Name of the component associated with the current notification. … … 704 703 * Output the name of the action associated with the notification currently being iterated on. 705 704 * 706 * @since BuddyPress (1.9.0)705 * @since 1.9.0 707 706 */ 708 707 function bp_the_notification_component_action() { … … 712 711 * Return the name of the action associated with the notification currently being iterated on. 713 712 * 714 * @since BuddyPress (1.9.0)713 * @since 1.9.0 715 714 * 716 715 * @return int Name of the action associated with the current notification. … … 721 720 * Filters the name of the action associated with the notification currently being iterated on. 722 721 * 723 * @since BuddyPress (1.9.0)722 * @since 1.9.0 724 723 * 725 724 * @param int $component_action Name of the action associated with the current notification. … … 731 730 * Output the timestamp of the current notification. 732 731 * 733 * @since BuddyPress (1.9.0)732 * @since 1.9.0 734 733 */ 735 734 function bp_the_notification_date_notified() { … … 739 738 * Return the timestamp of the current notification. 740 739 * 741 * @since BuddyPress (1.9.0)740 * @since 1.9.0 742 741 * 743 742 * @return string Timestamp of the current notification. … … 748 747 * Filters the timestamp of the current notification. 749 748 * 750 * @since BuddyPress (1.9.0)749 * @since 1.9.0 751 750 * 752 751 * @param string $date_notified Timestamp of the current notification. … … 758 757 * Output the timestamp of the current notification. 759 758 * 760 * @since BuddyPress (1.9.0)759 * @since 1.9.0 761 760 */ 762 761 function bp_the_notification_time_since() { … … 766 765 * Return the timestamp of the current notification. 767 766 * 768 * @since BuddyPress (1.9.0)767 * @since 1.9.0 769 768 * 770 769 * @return string Timestamp of the current notification. … … 787 786 * Filters the time since value of the current notification. 788 787 * 789 * @since BuddyPress (1.9.0)788 * @since 1.9.0 790 789 * 791 790 * @param string $retval Time since value for current notification. … … 797 796 * Output full-text description for a specific notification. 798 797 * 799 * @since BuddyPress (1.9.0)798 * @since 1.9.0 800 799 */ 801 800 function bp_the_notification_description() { … … 806 805 * Get full-text description for a specific notification. 807 806 * 808 * @since BuddyPress (1.9.0)807 * @since 1.9.0 809 808 * 810 809 * @return string … … 832 831 * Filters the full-text description for a specific notification. 833 832 * 834 * @since BuddyPress (1.9.0)835 * @since BuddyPress (2.3.0)Added the `$notification` parameter.833 * @since 1.9.0 834 * @since 2.3.0 Added the `$notification` parameter. 836 835 * 837 836 * @param string $description Full-text description for a specific notification. … … 844 843 * Output the mark read link for the current notification. 845 844 * 846 * @since BuddyPress (1.9.0)845 * @since 1.9.0 847 846 * 848 847 * @uses bp_get_the_notification_mark_read_link() … … 854 853 * Return the mark read link for the current notification. 855 854 * 856 * @since BuddyPress (1.9.0)855 * @since 1.9.0 857 856 */ 858 857 function bp_get_the_notification_mark_read_link() { … … 868 867 * Filters the mark read link for the current notification. 869 868 * 870 * @since BuddyPress (1.9.0)869 * @since 1.9.0 871 870 * 872 871 * @param string $retval HTML for the mark read link for the current notification. … … 880 879 * Since this function directly outputs a URL, it is escaped. 881 880 * 882 * @since BuddyPress (2.1.0)881 * @since 2.1.0 883 882 * 884 883 * @uses bp_get_the_notification_mark_read_url() … … 890 889 * Return the URL used for marking a single notification as read. 891 890 * 892 * @since BuddyPress (2.1.0)891 * @since 2.1.0 893 892 */ 894 893 function bp_get_the_notification_mark_read_url() { … … 912 911 * Filters the URL used for marking a single notification as read. 913 912 * 914 * @since BuddyPress (2.1.0)913 * @since 2.1.0 915 914 * 916 915 * @param string $url URL to use for marking the single notification as read. … … 922 921 * Output the mark unread link for the current notification. 923 922 * 924 * @since BuddyPress (1.9.0)923 * @since 1.9.0 925 924 * 926 925 * @uses bp_get_the_notification_mark_unread_link() … … 932 931 * Return the mark unread link for the current notification. 933 932 * 934 * @since BuddyPress (1.9.0)933 * @since 1.9.0 935 934 */ 936 935 function bp_get_the_notification_mark_unread_link() { … … 946 945 * Filters the link used for marking a single notification as unread. 947 946 * 948 * @since BuddyPress (1.9.0)947 * @since 1.9.0 949 948 * 950 949 * @param string $retval HTML for the mark unread link for the current notification. … … 958 957 * Since this function directly outputs a URL, it is escaped. 959 958 * 960 * @since BuddyPress (2.1.0)959 * @since 2.1.0 961 960 * 962 961 * @uses bp_get_the_notification_mark_unread_url() … … 968 967 * Return the URL used for marking a single notification as unread. 969 968 * 970 * @since BuddyPress (2.1.0)969 * @since 2.1.0 971 970 */ 972 971 function bp_get_the_notification_mark_unread_url() { … … 990 989 * Filters the URL used for marking a single notification as unread. 991 990 * 992 * @since BuddyPress (2.1.0)991 * @since 2.1.0 993 992 * 994 993 * @param string $url URL to use for marking the single notification as unread. … … 1000 999 * Output the mark link for the current notification. 1001 1000 * 1002 * @since BuddyPress (1.9.0)1001 * @since 1.9.0 1003 1002 * 1004 1003 * @uses bp_get_the_notification_mark_unread_link() … … 1010 1009 * Return the mark link for the current notification. 1011 1010 * 1012 * @since BuddyPress (1.9.0)1011 * @since 1.9.0 1013 1012 */ 1014 1013 function bp_get_the_notification_mark_link() { … … 1023 1022 * Filters the mark link for the current notification. 1024 1023 * 1025 * @since BuddyPress (1.9.0)1024 * @since 1.9.0 1026 1025 * 1027 1026 * @param string $retval The mark link for the current notification. … … 1033 1032 * Output the delete link for the current notification. 1034 1033 * 1035 * @since BuddyPress (1.9.0)1034 * @since 1.9.0 1036 1035 * 1037 1036 * @uses bp_get_the_notification_delete_link() … … 1043 1042 * Return the delete link for the current notification. 1044 1043 * 1045 * @since BuddyPress (1.9.0)1044 * @since 1.9.0 1046 1045 */ 1047 1046 function bp_get_the_notification_delete_link() { … … 1057 1056 * Filters the delete link for the current notification. 1058 1057 * 1059 * @since BuddyPress (1.9.0)1058 * @since 1.9.0 1060 1059 * 1061 1060 * @param string $retval HTML for the delete link for the current notification. … … 1069 1068 * Since this function directly outputs a URL, it is escaped. 1070 1069 * 1071 * @since BuddyPress (2.1.0)1070 * @since 2.1.0 1072 1071 * 1073 1072 * @uses esc_url() … … 1080 1079 * Return the URL used for deleting a single notification. 1081 1080 * 1082 * @since BuddyPress (2.1.0)1081 * @since 2.1.0 1083 1082 * 1084 1083 * @return string … … 1111 1110 * Filters the URL used for deleting a single notification. 1112 1111 * 1113 * @since BuddyPress (2.1.0)1112 * @since 2.1.0 1114 1113 * 1115 1114 * @param string $url URL used for deleting a single notification. … … 1122 1121 * 1123 1122 * @param array|string $args Array of arguments. 1124 * @since BuddyPress (1.9.0)1123 * @since 1.9.0 1125 1124 */ 1126 1125 function bp_the_notification_action_links( $args = '' ) { … … 1130 1129 * Return the action links for the current notification. 1131 1130 * 1132 * @since BuddyPress (1.9.0)1131 * @since 1.9.0 1133 1132 * 1134 1133 * @param array|string $args { … … 1160 1159 * Filters the action links for the current notification. 1161 1160 * 1162 * @since BuddyPress (1.9.0)1161 * @since 1.9.0 1163 1162 * 1164 1163 * @param string $retval HTML links for actions to take on single notifications. … … 1170 1169 * Output the pagination count for the current notification loop. 1171 1170 * 1172 * @since BuddyPress (1.9.0)1171 * @since 1.9.0 1173 1172 */ 1174 1173 function bp_notifications_pagination_count() { … … 1178 1177 * Return the pagination count for the current notification loop. 1179 1178 * 1180 * @since BuddyPress (1.9.0)1179 * @since 1.9.0 1181 1180 * 1182 1181 * @return string HTML for the pagination count. … … 1198 1197 * Filters the pagination count for the current notification loop. 1199 1198 * 1200 * @since BuddyPress (1.9.0)1199 * @since 1.9.0 1201 1200 * 1202 1201 * @param string $pag HTML for the pagination count. … … 1208 1207 * Output the pagination links for the current notification loop. 1209 1208 * 1210 * @since BuddyPress (1.9.0)1209 * @since 1.9.0 1211 1210 */ 1212 1211 function bp_notifications_pagination_links() { … … 1216 1215 * Return the pagination links for the current notification loop. 1217 1216 * 1218 * @since BuddyPress (1.9.0)1217 * @since 1.9.0 1219 1218 * 1220 1219 * @return string HTML for the pagination links. … … 1225 1224 * Filters the pagination links for the current notification loop. 1226 1225 * 1227 * @since BuddyPress (1.9.0)1226 * @since 1.9.0 1228 1227 * 1229 1228 * @param string $pag_links HTML for the pagination links. … … 1237 1236 * Output the form for changing the sort order of notifications. 1238 1237 * 1239 * @since BuddyPress (1.9.0)1238 * @since 1.9.0 1240 1239 */ 1241 1240 function bp_notifications_sort_order_form() { … … 1271 1270 * Output the dropdown for bulk management of notifications. 1272 1271 * 1273 * @since BuddyPress (2.2.0)1272 * @since 2.2.0 1274 1273 */ 1275 1274 function bp_notifications_bulk_management_dropdown() {
Note: See TracChangeset
for help on using the changeset viewer.