Ticket #5945: bp-messages-template-5945.diff
| File bp-messages-template-5945.diff, 22.9 KB (added by , 11 years ago) |
|---|
-
src/bp-messages/bp-messages-template.php
251 251 if ( $this->current_thread + 1 < $this->thread_count ) { 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(); 257 263 } … … 307 313 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 } 312 324 } … … 377 389 $r['page_arg'] 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 } 382 403 … … 414 435 function bp_get_message_thread_id() { 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 } 419 447 … … 431 459 function bp_get_message_thread_subject() { 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 } 436 471 … … 448 483 function bp_get_message_thread_excerpt() { 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 } 453 495 … … 480 522 function bp_get_message_thread_content() { 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 } 485 534 … … 497 546 function bp_get_message_thread_from() { 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 } 502 558 … … 513 569 */ 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 } 518 582 … … 541 605 $thread_id = $messages_template->thread->thread_id; 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 } 546 617 … … 557 628 */ 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 } 562 642 … … 597 677 // Add the nonce. 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 } 603 689 … … 638 724 // Add the nonce. 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 } 644 736 … … 662 754 $class .= 'alt'; 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 } 667 766 … … 677 776 ? true 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 } 682 788 … … 698 804 ? (int) $messages_template->thread->unread_count 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 } 703 816 … … 734 847 $count = intval( $thread_template->message_count ); 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 } 739 859 … … 782 902 function bp_get_message_thread_last_post_date_raw() { 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 } 787 914 … … 797 924 * @return string 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 } 802 937 … … 844 979 'alt' => $alt 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, 849 991 'type' => $r['type'], … … 867 1009 * @return int 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 } 872 1022 … … 883 1033 */ 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 } 888 1046 … … 932 1090 * @return string The form action 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 } 937 1103 … … 948 1114 */ 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 } 955 1133 } … … 973 1151 ? $_POST['subject'] 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 } 978 1163 … … 996 1181 ? $_POST['content'] 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 } 1001 1193 … … 1058 1250 ? true 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 } 1063 1262 … … 1105 1304 */ 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 } 1110 1317 … … 1121 1328 */ 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 } 1126 1341 … … 1137 1352 */ 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 } 1142 1365 … … 1153 1376 */ 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 } 1158 1389 … … 1170 1401 function bp_get_message_notice_delete_link() { 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 } 1175 1414 … … 1192 1431 } else { 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 } 1197 1444 … … 1202 1449 echo bp_get_message_activate_deactivate_text(); 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 1208 1455 */ … … 1214 1461 } else { 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 } 1219 1474 … … 1235 1490 * @return string 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 } 1240 1503 … … 1286 1549 return false; 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 } 1291 1561 … … 1317 1587 // Note: 'bp_get_send_message_button' is a legacy filter. Use 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', 1322 1599 'component' => 'messages', … … 1343 1620 * @return string 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 } 1348 1633 … … 1385 1670 function bp_get_message_get_recipient_usernames() { 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 } 1390 1682 … … 1535 1827 if ( ( $this->current_message + 1 ) < $this->message_count ) { 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 1540 1838 $this->rewind_messages(); … … 1559 1857 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 } 1564 1868 } … … 1652 1956 function bp_get_the_thread_id() { 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 } 1657 1968 … … 1669 1980 function bp_get_the_thread_subject() { 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 } 1674 1992 … … 1735 2053 } 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 } 1740 2065 … … 1760 2085 ? (int) $thread_template->message->id 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 } 1765 2097 … … 1794 2126 $classes[] = 'sent-by-me'; 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 1799 2138 return implode( ' ', $classes ); … … 1819 2158 $class = 'odd'; 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 } 1824 2170 … … 1844 2190 ? $thread_template->message->sender_id 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 } 1849 2202 … … 1877 2230 'height' => false, 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, 1882 2242 'type' => $r['type'], … … 1900 2260 function bp_get_the_thread_message_sender_link() { 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 } 1905 2272 … … 1923 2290 $display_name = __( 'Deleted User', 'buddypress' ); 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 } 1928 2302 … … 1938 2312 * @return string URL 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 } 1943 2326 … … 1953 2336 * @return string 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 } 1958 2349 … … 1975 2366 function bp_get_the_thread_message_date_sent() { 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 } 1980 2378 … … 1992 2390 function bp_get_the_thread_message_content() { 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 } 1997 2402