Changeset 9216
- Timestamp:
- 12/07/2014 12:27:30 AM (11 years ago)
- Location:
- trunk/src/bp-messages
- Files:
-
- 6 edited
-
bp-messages-classes.php (modified) (6 diffs)
-
bp-messages-functions.php (modified) (5 diffs)
-
bp-messages-notifications.php (modified) (5 diffs)
-
bp-messages-screens.php (modified) (7 diffs)
-
bp-messages-template.php (modified) (56 diffs)
-
bp-messages-widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-classes.php
r9185 r9216 269 269 // No more recipients so delete all messages associated with the thread 270 270 if ( empty( $recipients ) ) { 271 271 272 /** 272 273 * Fires before an entire message thread is deleted. … … 732 733 $this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id ); 733 734 735 /** 736 * Fires before the current message item gets saved. 737 * 738 * Please use this hook to filter the properties above. Each part will be passed in. 739 * 740 * @since BuddyPress (1.0.0) 741 * 742 * @param BP_Messages_Message Current instance of the message item being saved. Passed by reference. 743 */ 734 744 do_action_ref_array( 'messages_message_before_save', array( &$this ) ); 735 745 … … 771 781 messages_remove_callback_values(); 772 782 783 /** 784 * Fires after the current message item has been saved. 785 * 786 * @since BuddyPress (1.0.0) 787 * 788 * @param BP_Messages_Message Current instance of the message item being saved. Passed by reference. 789 */ 773 790 do_action_ref_array( 'messages_message_after_save', array( &$this ) ); 774 791 … … 934 951 $this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id ); 935 952 953 /** 954 * Fires before the current message notice item gets saved. 955 * 956 * Please use this hook to filter the properties above. Each part will be passed in. 957 * 958 * @since BuddyPress (1.0.0) 959 * 960 * @param BP_Messages_Notice Current instance of the message notice item being saved. Passed by reference. 961 */ 936 962 do_action_ref_array( 'messages_notice_before_save', array( &$this ) ); 937 963 … … 955 981 bp_update_user_last_activity( bp_loggedin_user_id(), bp_core_current_time() ); 956 982 983 /** 984 * Fires after the current message notice item has been saved. 985 * 986 * @since BuddyPress (1.0.0) 987 * 988 * @param BP_Messages_Notice Current instance of the message item being saved. Passed by reference. 989 */ 957 990 do_action_ref_array( 'messages_notice_after_save', array( &$this ) ); 958 991 … … 994 1027 global $wpdb, $bp; 995 1028 1029 /** 1030 * Fires before the current message item has been deleted. 1031 * 1032 * @since BuddyPress (1.0.0) 1033 * 1034 * @param BP_Messages_Notice Current instance of the message notice item being deleted. 1035 */ 996 1036 do_action( 'messages_notice_before_delete', $this ); 997 1037 -
trunk/src/bp-messages/bp-messages-functions.php
r9182 r9216 156 156 } 157 157 158 // Allow additional actions when a message is sent successfully 158 /** 159 * Fires after a message has been successfully sent. 160 * 161 * @since BuddyPress (1.1.0) 162 * 163 * @param BP_Messages_Message $message Message object. Passed by reference. 164 */ 159 165 do_action_ref_array( 'messages_message_sent', array( &$message ) ); 160 166 … … 183 189 $notice->save(); // send it. 184 190 191 /** 192 * Fires after a notice has been successfully sent. 193 * 194 * @since BuddyPress (1.0.0) 195 * 196 * @param string $subject Subject of the notice. 197 * @param string $message Content of the notice. 198 */ 185 199 do_action_ref_array( 'messages_send_notice', array( $subject, $message ) ); 186 200 … … 196 210 */ 197 211 function messages_delete_thread( $thread_ids ) { 212 213 /** 214 * Fires before specified thread IDs have been deleted. 215 * 216 * @since BuddyPress (1.5.0) 217 * 218 * @param int|array Thread ID or array of thread IDs that were deleted. 219 */ 198 220 do_action( 'messages_before_delete_thread', $thread_ids ); 199 221 … … 210 232 } 211 233 234 /** 235 * Fires after specified thread IDs have been deleted. 236 * 237 * @since BuddyPress (1.0.0) 238 * 239 * @param int|array Thread ID or array of thread IDs that were deleted. 240 */ 212 241 do_action( 'messages_delete_thread', $thread_ids ); 213 242 … … 218 247 } 219 248 249 /** This action is documented in bp-messages/bp-messages-functions.php */ 220 250 do_action( 'messages_delete_thread', $thread_ids ); 221 251 -
trunk/src/bp-messages/bp-messages-notifications.php
r9208 r9216 93 93 } 94 94 95 // Send the message 95 /** 96 * Filters the user email that the message notification will be sent to. 97 * 98 * @since BuddyPress (1.2.0) 99 * 100 * @param string $email_to User email the notification is being sent to. 101 * @param WP_User $ud WP_User object of who is receiving the message. 102 */ 96 103 $email_to = apply_filters( 'messages_notification_new_message_to', $email_to, $ud ); 104 105 /** 106 * Filters the message notification subject that will be sent to user. 107 * 108 * @since BuddyPress (1.2.0) 109 * 110 * @param string $email_subject Email notification subject text. 111 * @param string $sender_name Name of the person who sent the message. 112 * @param WP_User $ud WP_User object of who is receiving the message. 113 */ 97 114 $email_subject = apply_filters( 'messages_notification_new_message_subject', $email_subject, $sender_name, $ud ); 115 116 /** 117 * Filters the message notification message that will be sent to user. 118 * 119 * @since BuddyPress (1.2.0) 120 * 121 * @param string $email_content Email notification message text. 122 * @param string $sender_name Name of the person who sent the message. 123 * @param string $subject Email notification subject text. 124 * @param string $content Content of the message. 125 * @param string $message_link URL permalink for the message. 126 * @param string $settings_link URL permalink for the user's notification settings area. 127 * @param WP_User $ud WP_User object of who is receiving the message. 128 */ 98 129 $email_content = apply_filters( 'messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud ); 99 130 … … 102 133 } 103 134 135 /** 136 * Fires after the sending of a new message email notification. 137 * 138 * @since BuddyPress (1.5.0) 139 * 140 * @param array $recipients User IDs of recipients. 141 * @param string $email_subject Email notification subject text. 142 * @param string $email_content Email notification message text. 143 * @param array $$args Array of originally provided arguments. 144 */ 104 145 do_action( 'bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args ); 105 146 } … … 126 167 $link = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox' ); 127 168 $title = __( 'Inbox', 'buddypress' ); 169 $amount = 'single'; 128 170 129 171 if ( 'new_message' === $action ) { … … 131 173 $amount = 'multiple'; 132 174 $text = sprintf( __( 'You have %d new messages', 'buddypress' ), $total_items ); 175 $amount = 'multiple'; 133 176 } else { 134 177 $amount = 'single'; … … 178 221 } 179 222 223 /** 224 * Fires right before returning the formatted message notifications. 225 * 226 * @since BuddyPress (1.0.0) 227 * 228 * @param string $action The type of message notification. 229 * @param int $item_id The primary item ID. 230 * @param int $secondary_item_id The secondary item ID. 231 * @param int $total_items Total amount of items to format. 232 */ 180 233 do_action( 'messages_format_notifications', $action, $item_id, $secondary_item_id, $total_items ); 181 234 -
trunk/src/bp-messages/bp-messages-screens.php
r9190 r9216 24 24 } 25 25 26 /** 27 * Fires right before the loading of the Messages inbox screen template file. 28 * 29 * @since BuddyPress (1.0.0) 30 */ 26 31 do_action( 'messages_screen_inbox' ); 32 33 /** 34 * Filters the template to load for the Messages inbox screen. 35 * 36 * @since BuddyPress (1.0.0) 37 * 38 * @param string $template Path to the messages template to load. 39 */ 27 40 bp_core_load_template( apply_filters( 'messages_template_inbox', 'members/single/home' ) ); 28 41 } … … 37 50 } 38 51 52 /** 53 * Fires right before the loading of the Messages sentbox screen template file. 54 * 55 * @since BuddyPress (1.0.0) 56 */ 39 57 do_action( 'messages_screen_sentbox' ); 58 59 /** 60 * Filters the template to load for the Messages sentbox screen. 61 * 62 * @since BuddyPress (1.0.0) 63 * 64 * @param string $template Path to the messages template to load. 65 */ 40 66 bp_core_load_template( apply_filters( 'messages_template_sentbox', 'members/single/home' ) ); 41 67 } … … 77 103 $typed_recipients = explode( ' ', $_POST['send_to_usernames'] ); 78 104 $recipients = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients ); 105 106 /** 107 * Filters the array of recipients to receive the composed message. 108 * 109 * @since BuddyPress (1.2.10) 110 * 111 * @param array $recipients Array of recipients to receive message. 112 */ 79 113 $recipients = apply_filters( 'bp_messages_recipients', $recipients ); 80 114 $thread_id = messages_new_message( array( … … 95 129 } 96 130 131 /** 132 * Fires right before the loading of the Messages compose screen template file. 133 * 134 * @since BuddyPress (1.0.0) 135 */ 97 136 do_action( 'messages_screen_compose' ); 98 137 138 /** 139 * Filters the template to load for the Messages compose screen. 140 * 141 * @since BuddyPress (1.0.0) 142 * 143 * @param string $template Path to the messages template to load. 144 */ 99 145 bp_core_load_template( apply_filters( 'messages_template_compose', 'members/single/home' ) ); 100 146 } … … 124 170 $bp->bp_nav[$bp->messages->slug]['name'] = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() ); 125 171 172 /** 173 * Fires right before the loading of the Messages view screen template file. 174 * 175 * @since BuddyPress (1.7.0) 176 */ 126 177 do_action( 'messages_screen_conversation' ); 127 178 179 /** 180 * Filters the template to load for the Messages view screen. 181 * 182 * @since BuddyPress (1.0.0) 183 * 184 * @param string $template Path to the messages template to load. 185 */ 128 186 bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) ); 129 187 } … … 174 232 } 175 233 234 /** 235 * Fires right before the loading of the Messages notices screen template file. 236 * 237 * @since BuddyPress (1.0.0) 238 */ 176 239 do_action( 'messages_screen_notices' ); 177 240 241 /** 242 * Filters the template to load for the Messages notices screen. 243 * 244 * @since BuddyPress (1.0.0) 245 * 246 * @param string $template Path to the messages template to load. 247 */ 178 248 bp_core_load_template( apply_filters( 'messages_template_notices', 'members/single/home' ) ); 179 249 } … … 210 280 </tr> 211 281 212 <?php do_action( 'messages_screen_notification_settings' ) ?> 282 <?php 283 284 /** 285 * Fires inside the closing </tbody> tag for messages screen notification settings. 286 * 287 * @since BuddyPress (1.0.0) 288 */ 289 do_action( 'messages_screen_notification_settings' ); ?> 213 290 </tbody> 214 291 </table> -
trunk/src/bp-messages/bp-messages-template.php
r9195 r9216 252 252 return true; 253 253 } elseif ( $this->current_thread + 1 == $this->thread_count ) { 254 do_action('messages_box_loop_end'); 254 255 /** 256 * Fires when at the end of threads to iterate over. 257 * 258 * @since BuddyPress (1.5.0) 259 */ 260 do_action( 'messages_box_loop_end' ); 255 261 // Do some cleaning up after the loop 256 262 $this->rewind_threads(); … … 308 314 // loop has just started 309 315 if ( 0 == $this->current_thread ) { 316 317 /** 318 * Fires if at the start of the message thread loop. 319 * 320 * @since BuddyPress (1.5.0) 321 */ 310 322 do_action( 'messages_box_loop_start' ); 311 323 } … … 378 390 ); 379 391 392 /** 393 * Filters if there are any message threads to display in inbox/sentbox/notices. 394 * 395 * @since BuddyPress (1.1.0) 396 * 397 * @param bool $value Whether or not the message has threads. 398 * @param BP_Messages_Box_Template $messages_template Current message box template object. 399 * @param array $r Array of parsed arguments passed into function. 400 */ 380 401 return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template, $r ); 381 402 } … … 415 436 global $messages_template; 416 437 438 /** 439 * Filters the ID of the current thread in the loop. 440 * 441 * @since BuddyPress (1.0.0) 442 * 443 * @param int $thread_id ID of the current thread in the loop. 444 */ 417 445 return apply_filters( 'bp_get_message_thread_id', $messages_template->thread->thread_id ); 418 446 } … … 432 460 global $messages_template; 433 461 462 /** 463 * Filters the subject of the current thread in the loop. 464 * 465 * @since BuddyPress (1.1.0) 466 * 467 * @param string $value Subject of the current thread in the loop. 468 */ 434 469 return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) ); 435 470 } … … 449 484 global $messages_template; 450 485 486 /** 487 * Filters the excerpt of the current thread in the loop. 488 * 489 * @since BuddyPress (1.0.0) 490 * 491 * @param string $value Excerpt of the current thread in the loop. 492 */ 451 493 return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 75 ) ) ); 452 494 } … … 481 523 global $messages_template; 482 524 525 /** 526 * Filters the content of the last message in the thread. 527 * 528 * @since BuddyPress (2.0.0) 529 * 530 * @param string $last_message_content Content of the last message in the thread. 531 */ 483 532 return apply_filters( 'bp_get_message_thread_content', $messages_template->thread->last_message_content ); 484 533 } … … 498 547 global $messages_template; 499 548 549 /** 550 * Filters the link to the page of the current thread's last author. 551 * 552 * @since BuddyPress (1.0.0) 553 * 554 * @param string $value Link to the page of the current thread's last author. 555 */ 500 556 return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink( $messages_template->thread->last_sender_id ) ); 501 557 } … … 514 570 function bp_get_message_thread_to() { 515 571 global $messages_template; 572 573 /** 574 * Filters the HTML links to the pages of the current thread's recipients. 575 * 576 * @since BuddyPress (1.0.0) 577 * 578 * @param string $value HTML links to the pages of the current thread's recipients. 579 */ 516 580 return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients ) ); 517 581 } … … 542 606 } 543 607 608 /** 609 * Filters the permalink of a particular thread. 610 * 611 * @since BuddyPress (1.0.0) 612 * 613 * @param string $value permalink of a particular thread. 614 */ 544 615 return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id ) ); 545 616 } … … 558 629 function bp_get_message_thread_delete_link() { 559 630 global $messages_template; 631 632 /** 633 * Filters the URL for deleting the current thread. 634 * 635 * @since BuddyPress (1.0.0) 636 * 637 * @param string $value URL for deleting the current thread. 638 * @param string $value Text indicating action being executed. 639 */ 560 640 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) ); 561 641 } … … 598 678 $url = wp_nonce_url( $url, 'bp_message_thread_mark_unread_' . $id ); 599 679 600 // Filter and return. 680 /** 681 * Filters the URL used for marking a single message thread as unread. 682 * 683 * @since BuddyPress (2.2.0) 684 * 685 * @param string $url URL used for marking a single message thread as unread. 686 */ 601 687 return apply_filters( 'bp_get_the_message_thread_mark_unread_url', $url ); 602 688 } … … 639 725 $url = wp_nonce_url( $url, 'bp_message_thread_mark_read_' . $id ); 640 726 641 // Filter and return. 727 /** 728 * Filters the URL used for marking a single message thread as read. 729 * 730 * @since BuddyPress (2.2.0) 731 * 732 * @param string $url URL used for marking a single message thread as read. 733 */ 642 734 return apply_filters( 'bp_get_the_message_thread_mark_read_url', $url ); 643 735 } … … 663 755 } 664 756 757 /** 758 * Filters the CSS class for the current thread. 759 * 760 * @since BuddyPress (1.2.10) 761 * 762 * @param string $class Class string to be added to the list of classes. 763 */ 665 764 return apply_filters( 'bp_get_message_css_class', trim( $class ) ); 666 765 } … … 678 777 : false; 679 778 779 /** 780 * Filters whether or not a message thread has unread items. 781 * 782 * @since BuddyPress (2.1.0) 783 * 784 * @param bool $retval Whether or not a message thread has unread items. 785 */ 680 786 return apply_filters( 'bp_message_thread_has_unread', $retval ); 681 787 } … … 699 805 : false; 700 806 807 /** 808 * Filters the current thread's unread count. 809 * 810 * @since BuddyPress (1.0.0) 811 * 812 * @param int $count Current thread unread count. 813 */ 701 814 return apply_filters( 'bp_get_message_thread_unread_count', $count ); 702 815 } … … 735 848 } 736 849 850 /** 851 * Filters the current thread's total message count. 852 * 853 * @since BuddyPress (2.2.0) 854 * 855 * @param int $count Current thread total message count. 856 */ 737 857 return apply_filters( 'bp_get_message_thread_total_count', $count ); 738 858 } … … 783 903 global $messages_template; 784 904 905 /** 906 * Filters the unformatted date of the last post in the current thread. 907 * 908 * @since BuddyPress (2.1.0) 909 * 910 * @param string $last_message_date Unformatted date of the last post in the current thread. 911 */ 785 912 return apply_filters( 'bp_get_message_thread_last_message_date', $messages_template->thread->last_message_date ); 786 913 } … … 798 925 */ 799 926 function bp_get_message_thread_last_post_date() { 927 928 /** 929 * Filters the nicely formatted date of the last post in the current thread. 930 * 931 * @since BuddyPress (2.1.0) 932 * 933 * @param string $value Formatted date of the last post in the current thread. 934 */ 800 935 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( bp_get_message_thread_last_post_date_raw() ) ) ); 801 936 } … … 845 980 ) ); 846 981 982 /** 983 * Filters the avatar for the last sender in the current message thread. 984 * 985 * @since BuddyPress (1.0.0) 986 * 987 * @param string $value User avatar string. 988 */ 847 989 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 848 990 'item_id' => $messages_template->thread->last_sender_id, … … 868 1010 */ 869 1011 function bp_get_total_unread_messages_count() { 1012 1013 /** 1014 * Filters the unread messages count for the current inbox. 1015 * 1016 * @since BuddyPress (1.0.0) 1017 * 1018 * @param int $value Unread messages count for the current inbox. 1019 */ 870 1020 return apply_filters( 'bp_get_total_unread_messages_count', BP_Messages_Thread::get_inbox_count() ); 871 1021 } … … 884 1034 function bp_get_messages_pagination() { 885 1035 global $messages_template; 1036 1037 /** 1038 * Filters the pagination HTML for the current thread loop. 1039 * 1040 * @since BuddyPress (1.0.0) 1041 * 1042 * @param int $pag_links Pagination HTML for the current thread loop. 1043 */ 886 1044 return apply_filters( 'bp_get_messages_pagination', $messages_template->pag_links ); 887 1045 } … … 933 1091 */ 934 1092 function bp_get_messages_form_action() { 1093 1094 /** 1095 * Filters the form action for Messages HTML forms. 1096 * 1097 * @since BuddyPress (1.0.0) 1098 * 1099 * @param string The form action. 1100 */ 935 1101 return apply_filters( 'bp_get_messages_form_action', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' . bp_action_variable( 0 ) ) ); 936 1102 } … … 949 1115 function bp_get_messages_username_value() { 950 1116 if ( isset( $_COOKIE['bp_messages_send_to'] ) ) { 1117 1118 /** 1119 * Filters the default username for the recipient box. 1120 * 1121 * Value passed into filter is dependent on if the 'bp_messages_send_to' 1122 * cookie or 'r' $_GET parameter is set. 1123 * 1124 * @since BuddyPress (1.0.0) 1125 * 1126 * @param string $value Default user name. 1127 */ 951 1128 return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] ); 952 1129 } else if ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) { 1130 /** This filter is documented in bp-messages-template.php */ 953 1131 return apply_filters( 'bp_get_messages_username_value', $_GET['r'] ); 954 1132 } … … 974 1152 : ''; 975 1153 1154 /** 1155 * Filters the default value for the subject field. 1156 * 1157 * @since BuddyPress (1.0.0) 1158 * 1159 * @param string $subject The default value for the subject field. 1160 */ 976 1161 return apply_filters( 'bp_get_messages_subject_value', $subject ); 977 1162 } … … 997 1182 : ''; 998 1183 1184 /** 1185 * Filters the default value for the content field. 1186 * 1187 * @since BuddyPress (1.0.0) 1188 * 1189 * @param string $content The default value for the content field. 1190 */ 999 1191 return apply_filters( 'bp_get_messages_content_value', $content ); 1000 1192 } … … 1059 1251 : false; 1060 1252 1253 /** 1254 * Filters whether or not the notice is currently active. 1255 * 1256 * @since BuddyPress (2.1.0) 1257 * 1258 * @param bool $retval Whether or not the notice is currently active. 1259 */ 1061 1260 return apply_filters( 'bp_messages_is_active_notice', $retval ); 1062 1261 } … … 1106 1305 function bp_get_message_notice_id() { 1107 1306 global $messages_template; 1307 1308 /** 1309 * Filters the ID of the current notice in the loop. 1310 * 1311 * @since BuddyPress (1.5.0) 1312 * 1313 * @param int $id ID of the current notice in the loop. 1314 */ 1108 1315 return apply_filters( 'bp_get_message_notice_id', $messages_template->thread->id ); 1109 1316 } … … 1122 1329 function bp_get_message_notice_post_date() { 1123 1330 global $messages_template; 1331 1332 /** 1333 * Filters the post date of the current notice in the loop. 1334 * 1335 * @since BuddyPress (1.0.0) 1336 * 1337 * @param string $value Formatted post date of the current notice in the loop. 1338 */ 1124 1339 return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime( $messages_template->thread->date_sent ) ) ); 1125 1340 } … … 1138 1353 function bp_get_message_notice_subject() { 1139 1354 global $messages_template; 1355 1356 /** 1357 * Filters the subject of the current notice in the loop. 1358 * 1359 * @since BuddyPress (1.0.0) 1360 * 1361 * @param string $subject Subject of the current notice in the loop. 1362 */ 1140 1363 return apply_filters( 'bp_get_message_notice_subject', $messages_template->thread->subject ); 1141 1364 } … … 1154 1377 function bp_get_message_notice_text() { 1155 1378 global $messages_template; 1379 1380 /** 1381 * Filters the text of the current notice in the loop. 1382 * 1383 * @since BuddyPress (1.0.0) 1384 * 1385 * @param string $message Text for the current notice in the loop. 1386 */ 1156 1387 return apply_filters( 'bp_get_message_notice_text', $messages_template->thread->message ); 1157 1388 } … … 1171 1402 global $messages_template; 1172 1403 1404 /** 1405 * Filters the URL for deleting the current notice. 1406 * 1407 * @since BuddyPress (1.0.0) 1408 * 1409 * @param string $value URL for deleting the current notice. 1410 * @param string $value Text indicating action being executed. 1411 */ 1173 1412 return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) ); 1174 1413 } … … 1193 1432 $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' ); 1194 1433 } 1434 1435 /** 1436 * Filters the URL for deactivating the current notice. 1437 * 1438 * @since BuddyPress (1.0.0) 1439 * 1440 * @param string $link URL for deactivating the current notice. 1441 */ 1195 1442 return apply_filters( 'bp_get_message_activate_deactivate_link', $link ); 1196 1443 } … … 1203 1450 } 1204 1451 /** 1205 * Generate the text ('Deactivate' or 'Activate' for the notice action link.1452 * Generate the text ('Deactivate' or 'Activate') for the notice action link. 1206 1453 * 1207 1454 * @return string … … 1215 1462 $text = __('Activate', 'buddypress'); 1216 1463 } 1464 1465 /** 1466 * Filters the "Deactivate" or "Activate" text for notice action links. 1467 * 1468 * @since BuddyPress (1.0.0) 1469 * 1470 * @param string $text Text used for notice action links. 1471 */ 1217 1472 return apply_filters( 'bp_message_activate_deactivate_text', $text ); 1218 1473 } … … 1236 1491 */ 1237 1492 function bp_get_messages_slug() { 1493 1494 /** 1495 * Filters the messages component slug. 1496 * 1497 * @since BuddyPress (1.5.0) 1498 * 1499 * @param string $slug Messages component slug. 1500 */ 1238 1501 return apply_filters( 'bp_get_messages_slug', buddypress()->messages->slug ); 1239 1502 } … … 1287 1550 } 1288 1551 1552 /** 1553 * Filters the URL for the Private Message link in member profile headers. 1554 * 1555 * @since BuddyPress (1.2.10) 1556 * 1557 * @param string $value URL for the Private Message link in member profile headers. 1558 */ 1289 1559 return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) ); 1290 1560 } … … 1318 1588 // 'bp_get_send_message_button_args' instead. See #4536 1319 1589 return apply_filters( 'bp_get_send_message_button', 1590 /** 1591 * Filters the "Private Message" button for member profile headers. 1592 * 1593 * @since BuddyPress (1.8.0) 1594 * 1595 * @param array $value See {@link BP_Button}. 1596 */ 1320 1597 bp_get_button( apply_filters( 'bp_get_send_message_button_args', array( 1321 1598 'id' => 'private_message', … … 1344 1621 */ 1345 1622 function bp_get_message_loading_image_src() { 1623 1624 /** 1625 * Filters the URL of the Messages AJAX loader gif. 1626 * 1627 * @since BuddyPress (1.0.0) 1628 * 1629 * @param string $value URL of the Messages AJAX loader gif. 1630 */ 1346 1631 return apply_filters( 'bp_get_message_loading_image_src', buddypress()->messages->image_base . '/ajax-loader.gif' ); 1347 1632 } … … 1386 1671 $recipients = isset( $_GET['r'] ) ? stripslashes( $_GET['r'] ) : ''; 1387 1672 1673 /** 1674 * Filters the recipients usernames for prefilling the 'To' field on the Compose screen. 1675 * 1676 * @since BuddyPress (1.0.0) 1677 * 1678 * @param string $recipients Recipients usernames for 'To' field prefilling. 1679 */ 1388 1680 return apply_filters( 'bp_get_message_get_recipient_usernames', $recipients ); 1389 1681 } … … 1536 1828 return true; 1537 1829 } elseif ( ( $this->current_message + 1 ) === $this->message_count ) { 1830 1831 /** 1832 * Fires when at the end of messages to iterate over. 1833 * 1834 * @since BuddyPress (1.1.0) 1835 */ 1538 1836 do_action( 'thread_loop_end' ); 1539 1837 // Do some cleaning up after the loop … … 1560 1858 // loop has just started 1561 1859 if ( 0 === $this->current_message ) { 1860 1861 /** 1862 * Fires if at the start of the message loop. 1863 * 1864 * @since BuddyPress (1.1.0) 1865 */ 1562 1866 do_action( 'thread_loop_start' ); 1563 1867 } … … 1653 1957 global $thread_template; 1654 1958 1959 /** 1960 * Filters the ID of the thread that the current loop belongs to. 1961 * 1962 * @since BuddyPress (1.1.0) 1963 * 1964 * @param int $thread_id ID of the thread. 1965 */ 1655 1966 return apply_filters( 'bp_get_the_thread_id', $thread_template->thread->thread_id ); 1656 1967 } … … 1670 1981 global $thread_template; 1671 1982 1983 /** 1984 * Filters the subject of the thread currently being iterated over. 1985 * 1986 * @since BuddyPress (1.1.0) 1987 * 1988 * @return string $last_message_subject Subject of the thread currently being iterated over. 1989 */ 1672 1990 return apply_filters( 'bp_get_the_thread_subject', $thread_template->thread->last_message_subject ); 1673 1991 } … … 1736 2054 } 1737 2055 2056 /** 2057 * Filters the HTML links to the profiles of recipients in the current thread. 2058 * 2059 * @since BuddyPress (2.2.0) 2060 * 2061 * @param string $value Comma-separated list of recipient HTML links for current thread. 2062 */ 1738 2063 return apply_filters( 'bp_get_the_thread_recipients_list', implode( ', ', $recipient_links ) ); 1739 2064 } … … 1761 2086 : null; 1762 2087 2088 /** 2089 * Filters the ID of the current message in the thread. 2090 * 2091 * @since BuddyPress (1.9.0) 2092 * 2093 * @param int $thread_message_id ID of the current message in the thread. 2094 */ 1763 2095 return apply_filters( 'bp_get_the_thread_message_id', $thread_message_id ); 1764 2096 } … … 1795 2127 } 1796 2128 2129 /** 2130 * Filters the CSS classes for messages within a single thread. 2131 * 2132 * @since BuddyPress (2.1.0) 2133 * 2134 * @param array $classes Array of classes to add to the HTML class attribute. 2135 */ 1797 2136 $classes = apply_filters( 'bp_get_the_thread_message_css_class', $classes ); 1798 2137 … … 1820 2159 } 1821 2160 2161 /** 2162 * Filters the CSS class used for message zebra striping. 2163 * 2164 * @since BuddyPress (1.1.0) 2165 * 2166 * @param string $class Class determined to be next for zebra striping effect. 2167 */ 1822 2168 return apply_filters( 'bp_get_the_thread_message_alt_class', $class ); 1823 2169 } … … 1845 2191 : 0; 1846 2192 2193 /** 2194 * Filters the ID for message sender within a single thread. 2195 * 2196 * @since BuddyPress (2.1.0) 2197 * 2198 * @param int $user_id ID of the message sender. 2199 */ 1847 2200 return (int) apply_filters( 'bp_get_the_thread_message_css_class', (int) $user_id ); 1848 2201 } … … 1878 2231 ) ); 1879 2232 2233 /** 2234 * Filters the avatar for the current message sender. 2235 * 2236 * @since BuddyPress (1.1.0) 2237 * 2238 * @param string $value <img> tag containing the avatar value. 2239 */ 1880 2240 return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array( 1881 2241 'item_id' => $thread_template->message->sender_id, … … 1901 2261 global $thread_template; 1902 2262 2263 /** 2264 * Filters the link to the sender of the current message. 2265 * 2266 * @since BuddyPress (1.1.0) 2267 * 2268 * @param string $value Link to the sender of the current message. 2269 */ 1903 2270 return apply_filters( 'bp_get_the_thread_message_sender_link', bp_core_get_userlink( $thread_template->message->sender_id, false, true ) ); 1904 2271 } … … 1924 2291 } 1925 2292 2293 /** 2294 * Filters the display name of the sender of the current message. 2295 * 2296 * @since BuddyPress (1.1.0) 2297 * 2298 * @param string $display_name Display name of the sender of the current message. 2299 */ 1926 2300 return apply_filters( 'bp_get_the_thread_message_sender_name', $display_name ); 1927 2301 } … … 1939 2313 */ 1940 2314 function bp_get_the_thread_delete_link() { 2315 2316 /** 2317 * Filters the URL for deleting the current thread. 2318 * 2319 * @since BuddyPress (1.0.0) 2320 * 2321 * @param string $value URL for deleting the current thread. 2322 * @param string $value Text indicating action being executed. 2323 */ 1941 2324 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) ); 1942 2325 } … … 1954 2337 */ 1955 2338 function bp_get_the_thread_message_time_since() { 2339 2340 /** 2341 * Filters the 'Sent x hours ago' string for the current message. 2342 * 2343 * @since BuddyPress (1.1.0) 2344 * 2345 * @param string $value Default text of 'Sent x hours ago'. 2346 */ 1956 2347 return apply_filters( 'bp_get_the_thread_message_time_since', sprintf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_get_the_thread_message_date_sent() ) ) ); 1957 2348 } … … 1976 2367 global $thread_template; 1977 2368 2369 /** 2370 * Filters the date sent value for the current message as a timestamp. 2371 * 2372 * @since BuddyPress (2.1.0) 2373 * 2374 * @param string $value Timestamp of the date sent value for the current message. 2375 */ 1978 2376 return apply_filters( 'bp_get_the_thread_message_date_sent', strtotime( $thread_template->message->date_sent ) ); 1979 2377 } … … 1993 2391 global $thread_template; 1994 2392 2393 /** 2394 * Filters the content of the current message in the loop. 2395 * 2396 * @since BuddyPress (1.1.0) 2397 * 2398 * @param string $message The content of the current message in the loop. 2399 */ 1995 2400 return apply_filters( 'bp_get_the_thread_message_content', $thread_template->message->message ); 1996 2401 } -
trunk/src/bp-messages/bp-messages-widgets.php
r9207 r9216 65 65 66 66 /** 67 * Filters the title of the Friends widget.67 * Filters the title of the Messages widget. 68 68 * 69 69 * @since BuddyPress (1.9.0)
Note: See TracChangeset
for help on using the changeset viewer.