Changeset 6438 for trunk/src/includes/forums/template.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r6433 r6438 33 33 */ 34 34 function bbp_get_forum_post_type() { 35 36 // Filter & return 35 37 return apply_filters( 'bbp_get_forum_post_type', bbpress()->forum_post_type ); 36 38 } … … 45 47 */ 46 48 function bbp_get_forum_post_type_labels() { 47 return apply_filters( 'bbp_get_forum_post_type_labels', array( 49 50 // Filter & return 51 return (array) apply_filters( 'bbp_get_forum_post_type_labels', array( 48 52 'name' => __( 'Forums', 'bbpress' ), 49 53 'menu_name' => __( 'Forums', 'bbpress' ), … … 76 80 */ 77 81 function bbp_get_forum_post_type_rewrite() { 78 return apply_filters( 'bbp_get_forum_post_type_rewrite', array( 82 83 // Filter & return 84 return (array) apply_filters( 'bbp_get_forum_post_type_rewrite', array( 79 85 'slug' => bbp_get_forum_slug(), 80 86 'with_front' => false … … 90 96 */ 91 97 function bbp_get_forum_post_type_supports() { 92 return apply_filters( 'bbp_get_forum_post_type_supports', array( 98 99 // Filter & return 100 return (array) apply_filters( 'bbp_get_forum_post_type_supports', array( 93 101 'title', 94 102 'editor', … … 148 156 $bbp->forum_query = new WP_Query( $bbp_f ); 149 157 158 // Filter & return 150 159 return apply_filters( 'bbp_has_forums', $bbp->forum_query->have_posts(), $bbp->forum_query ); 151 160 } … … 250 259 } 251 260 261 // Filter & return 252 262 return (int) apply_filters( 'bbp_get_forum_id', (int) $bbp_forum_id, $forum_id ); 253 263 } … … 298 308 } 299 309 310 // Filter & return 300 311 return apply_filters( 'bbp_get_forum', $forum, $output, $filter ); 301 312 } … … 340 351 } 341 352 353 // Filter & return 342 354 return apply_filters( 'bbp_get_forum_permalink', $forum_permalink, $forum_id ); 343 355 } … … 369 381 $title = get_the_title( $forum_id ); 370 382 383 // Filter & return 371 384 return apply_filters( 'bbp_get_forum_title', $title, $forum_id ); 372 385 } … … 415 428 } 416 429 430 // Filter & return 417 431 return apply_filters( 'bbp_get_forum_archive_title', $title ); 418 432 } … … 453 467 $content = get_post_field( 'post_content', $forum_id ); 454 468 469 // Filter & return 455 470 return apply_filters( 'bbp_get_forum_content', $content, $forum_id ); 456 471 } … … 495 510 $active_id = get_post_meta( $forum_id, '_bbp_last_active_id', true ); 496 511 512 // Filter & return 497 513 return (int) apply_filters( 'bbp_get_forum_last_active_id', (int) $active_id, $forum_id ); 498 514 } … … 548 564 $active_time = ! empty( $last_active ) ? bbp_get_time_since( bbp_convert_date( $last_active ) ) : ''; 549 565 566 // Filter & return 550 567 return apply_filters( 'bbp_get_forum_last_active', $active_time, $forum_id ); 551 568 } … … 617 634 } 618 635 636 // Filter & return 619 637 return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id ); 620 638 } … … 646 664 $parent_id = get_post_field( 'post_parent', $forum_id ); 647 665 666 // Filter & return 648 667 return (int) apply_filters( 'bbp_get_forum_parent_id', (int) $parent_id, $forum_id ); 649 668 } … … 673 692 } 674 693 694 // Filter & return 675 695 return apply_filters( 'bbp_get_forum_ancestors', $ancestors, $forum_id ); 676 696 } … … 741 761 : array(); 742 762 763 // Filter & return 743 764 return (array) apply_filters( 'bbp_forum_get_subforums', $sub_forums, $r, $args ); 744 765 } … … 889 910 } 890 911 912 // Filter & return 891 913 return apply_filters( 'bbp_get_forum_subscribe_link', $retval, $r, $args ); 892 914 } … … 921 943 $topic_id = get_post_meta( $forum_id, '_bbp_last_topic_id', true ); 922 944 945 // Filter & return 923 946 return (int) apply_filters( 'bbp_get_forum_last_topic_id', (int) $topic_id, $forum_id ); 924 947 } … … 953 976 $title = ! empty( $topic_id ) ? bbp_get_topic_title( $topic_id ) : ''; 954 977 978 // Filter & return 955 979 return apply_filters( 'bbp_get_forum_last_topic_title', $title, $forum_id ); 956 980 } … … 986 1010 $link = bbp_get_topic_permalink( $topic_id ); 987 1011 1012 // Filter & return 988 1013 return apply_filters( 'bbp_get_forum_last_topic_permalink', $link, $forum_id, $topic_id ); 989 1014 } … … 1007 1032 $author_id = bbp_get_topic_author_id( $topic_id ); 1008 1033 1034 // Filter & return 1009 1035 return (int) apply_filters( 'bbp_get_forum_last_topic_author_id', (int) $author_id, $forum_id, $topic_id ); 1010 1036 } … … 1041 1067 $author_link = bbp_get_user_profile_link( $author_id ); 1042 1068 1069 // Filter & return 1043 1070 return apply_filters( 'bbp_get_forum_last_topic_author_link', $author_link, $forum_id ); 1044 1071 } … … 1074 1101 $reply_id = get_post_meta( $forum_id, '_bbp_last_reply_id', true ); 1075 1102 1103 // Filter & return 1076 1104 return (int) apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id ); 1077 1105 } … … 1102 1130 $title = bbp_get_reply_title( $reply_id ); 1103 1131 1132 // Filter & return 1104 1133 return apply_filters( 'bbp_get_forum_last_reply_title', $title, $forum_id, $reply_id ); 1105 1134 } … … 1134 1163 $link = bbp_get_reply_permalink( $reply_id ); 1135 1164 1165 // Filter & return 1136 1166 return apply_filters( 'bbp_get_forum_last_reply_permalink', $link, $forum_id, $reply_id ); 1137 1167 } … … 1181 1211 } 1182 1212 1183 // Filter andreturn1213 // Filter & return 1184 1214 return apply_filters( 'bbp_get_forum_last_reply_url', $reply_url, $forum_id, $reply_id ); 1185 1215 } … … 1216 1246 $author_id = bbp_get_reply_author_id( $reply_id ); 1217 1247 1248 // Filter & return 1218 1249 return apply_filters( 'bbp_get_forum_last_reply_author_id', $author_id, $forum_id, $reply_id ); 1219 1250 } … … 1251 1282 $author_link = bbp_get_user_profile_link( $author_id ); 1252 1283 1284 // Filter & return 1253 1285 return apply_filters( 'bbp_get_forum_last_reply_author_link', $author_link, $forum_id, $author_id ); 1254 1286 } … … 1310 1342 } 1311 1343 1344 // Filter & return 1312 1345 return apply_filters( 'bbp_get_forum_topics_link', $retval, $forum_id ); 1313 1346 } … … 1535 1568 } 1536 1569 1570 // Filter & return 1537 1571 return apply_filters( 'bbp_get_forum_status', $status, $forum_id ); 1538 1572 } … … 1565 1599 $visibility = get_post_status( $forum_id ); 1566 1600 1601 // Filter & return 1567 1602 return apply_filters( 'bbp_get_forum_visibility', $visibility, $forum_id ); 1568 1603 } … … 1596 1631 } 1597 1632 1633 // Filter & return 1598 1634 return apply_filters( 'bbp_get_forum_type', $retval, $forum_id ); 1599 1635 } … … 1613 1649 $retval = ( ! empty( $type ) && 'category' === $type ); 1614 1650 1651 // Filter & return 1615 1652 return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id ); 1616 1653 } … … 1651 1688 $retval = bbp_is_forum_status( $forum_id, bbp_get_closed_status_id(), $check_ancestors, 'OR' ); 1652 1689 1690 // Filter & return 1653 1691 return (bool) apply_filters( 'bbp_is_forum_closed', (bool) $retval, $forum_id, $check_ancestors ); 1654 1692 } … … 1724 1762 } 1725 1763 1726 // Filter andreturn1764 // Filter & return 1727 1765 return (bool) apply_filters( 'bbp_is_forum_status', $retval, $count, $forum_id, $status_name, $check_ancestors, $operator ); 1728 1766 } … … 1747 1785 $retval = bbp_is_forum_visibility( $forum_id, bbp_get_public_status_id(), $check_ancestors ); 1748 1786 1749 return (bool) apply_filters( 'bbp_is_forum_public', (bool) $retval, $forum_id, $check_ancestors ); 1787 // Filter & return 1788 return (bool) apply_filters( 'bbp_is_forum_public', $retval, $forum_id, $check_ancestors ); 1750 1789 } 1751 1790 … … 1769 1808 $retval = bbp_is_forum_visibility( $forum_id, bbp_get_private_status_id(), $check_ancestors, 'OR' ); 1770 1809 1771 return (bool) apply_filters( 'bbp_is_forum_private', (bool) $retval, $forum_id, $check_ancestors ); 1810 // Filter & return 1811 return (bool) apply_filters( 'bbp_is_forum_private', $retval, $forum_id, $check_ancestors ); 1772 1812 } 1773 1813 … … 1792 1832 $retval = bbp_is_forum_visibility( $forum_id, bbp_get_hidden_status_id(), $check_ancestors, 'OR' ); 1793 1833 1794 return (bool) apply_filters( 'bbp_is_forum_hidden', (bool) $retval, $forum_id, $check_ancestors ); 1834 // Filter & return 1835 return (bool) apply_filters( 'bbp_is_forum_hidden', $retval, $forum_id, $check_ancestors ); 1795 1836 } 1796 1837 … … 1868 1909 } 1869 1910 1870 // Filter andreturn1911 // Filter & return 1871 1912 return (bool) apply_filters( 'bbp_is_forum_visibility', $retval, $count, $forum_id, $status_name, $check_ancestors, $operator ); 1872 1913 } … … 1899 1940 $author_id = get_post_field( 'post_author', $forum_id ); 1900 1941 1942 // Filter & return 1901 1943 return (int) apply_filters( 'bbp_get_forum_author_id', (int) $author_id, $forum_id ); 1902 1944 } … … 1931 1973 $author = get_the_author_meta( 'display_name', $author_id ); 1932 1974 1975 // Filter & return 1933 1976 return apply_filters( 'bbp_get_forum_author_display_name', $author, $forum_id, $author_id ); 1934 1977 } … … 1952 1995 } 1953 1996 1997 // Filter & return 1954 1998 return apply_filters( 'bbp_suppress_private_forum_meta', $retval ); 1955 1999 } … … 2006 2050 } 2007 2051 2052 // Filter & return 2008 2053 return apply_filters( 'bbp_suppress_private_author_link', $retval, $author_link, $args ); 2009 2054 } … … 2195 2240 $retstr = $r['before'] . $retstr . $r['after']; 2196 2241 2197 // Return filtered result2242 // Filter & return 2198 2243 return apply_filters( 'bbp_get_single_forum_description', $retstr, $r, $args ); 2199 2244 } … … 2235 2280 } 2236 2281 2282 // Filter & return 2237 2283 return apply_filters( 'bbp_get_form_forum_title', $forum_title ); 2238 2284 } … … 2272 2318 } 2273 2319 2320 // Filter & return 2274 2321 return apply_filters( 'bbp_get_form_forum_content', $forum_content ); 2275 2322 } … … 2326 2373 } 2327 2374 2375 // Filter & return 2328 2376 return apply_filters( 'bbp_get_form_forum_moderators', $forum_mods ); 2329 2377 } … … 2364 2412 } 2365 2413 2414 // Filter & return 2366 2415 return apply_filters( 'bbp_get_form_forum_parent', $forum_parent ); 2367 2416 } … … 2402 2451 } 2403 2452 2453 // Filter & return 2404 2454 return apply_filters( 'bbp_get_form_forum_type', $forum_type ); 2405 2455 } … … 2440 2490 } 2441 2491 2492 // Filter & return 2442 2493 return apply_filters( 'bbp_get_form_forum_visibility', $forum_visibility ); 2443 2494 } … … 2500 2551 $checked = checked( $forum_subscribed, true, false ); 2501 2552 2553 // Filter & return 2502 2554 return apply_filters( 'bbp_get_form_forum_subscribed', $checked, $forum_subscribed ); 2503 2555 } … … 2591 2643 <?php 2592 2644 2593 // Return the results2645 // Filter & return 2594 2646 return apply_filters( 'bbp_get_form_forum_type_dropdown', ob_get_clean(), $r, $args ); 2595 2647 } … … 2681 2733 <?php 2682 2734 2683 // Return the results2735 // Filter & return 2684 2736 return apply_filters( 'bbp_get_form_forum_status_dropdown', ob_get_clean(), $r, $args ); 2685 2737 } … … 2771 2823 <?php 2772 2824 2773 // Return the results2825 // Filter & return 2774 2826 return apply_filters( 'bbp_get_form_forum_type_dropdown', ob_get_clean(), $r, $args ); 2775 2827 } … … 2868 2920 } 2869 2921 2922 // Filter & return 2870 2923 return apply_filters( 'bbp_get_forum_topics_feed_link', $link, $url, $forum_id ); 2871 2924 } … … 2932 2985 } 2933 2986 2987 // Filter & return 2934 2988 return apply_filters( 'bbp_get_forum_replies_feed_link', $link, $url, $forum_id ); 2935 2989 }
Note: See TracChangeset
for help on using the changeset viewer.