Changeset 6438
- Timestamp:
- 05/27/2017 05:04:31 PM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/admin.php
r6419 r6438 448 448 } 449 449 450 // Filter & return 450 451 return apply_filters( 'bbp_map_settings_meta_caps', $caps, $cap, $user_id, $args ); 451 452 } -
trunk/src/includes/admin/common.php
r6415 r6438 167 167 $value = rtrim( $value, '/' ); 168 168 169 // Filter the result andreturn169 // Filter & return 170 170 return apply_filters( 'bbp_sanitize_slug', $value, $slug ); 171 171 } -
trunk/src/includes/admin/forums.php
r6398 r6438 540 540 */ 541 541 private function get_allowed_notice_toggles() { 542 543 // Filter & return 542 544 return apply_filters( 'bbp_admin_forums_allowed_notice_toggles', array( 543 545 'opened', … … 554 556 */ 555 557 private function get_allowed_action_toggles() { 558 559 // Filter & return 556 560 return apply_filters( 'bbp_admin_forums_allowed_action_toggles', array( 557 561 'bbp_toggle_forum_close' … … 588 592 } 589 593 594 // Filter & return 590 595 return apply_filters( 'bbp_admin_forums_column_headers', $columns ); 591 596 } -
trunk/src/includes/admin/metaboxes.php
r6424 r6438 51 51 } 52 52 53 // Filter andreturn53 // Filter & return 54 54 return apply_filters( 'bbp_dashboard_at_a_glance', $elements, $r ); 55 55 } -
trunk/src/includes/admin/replies.php
r6424 r6438 642 642 */ 643 643 private function get_allowed_notice_toggles() { 644 645 // Filter & return 644 646 return apply_filters( 'bbp_admin_replies_allowed_notice_toggles', array( 645 647 'spammed', … … 658 660 */ 659 661 private function get_allowed_action_toggles() { 662 663 // Filter & return 660 664 return apply_filters( 'bbp_admin_replies_allowed_action_toggles', array( 661 665 'bbp_toggle_reply_spam', … … 684 688 ); 685 689 690 // Filter & return 686 691 return apply_filters( 'bbp_admin_replies_column_headers', $columns ); 687 692 } -
trunk/src/includes/admin/settings.php
r6435 r6438 21 21 */ 22 22 function bbp_admin_get_settings_sections() { 23 24 // Filter & return 23 25 return (array) apply_filters( 'bbp_admin_get_settings_sections', array( 24 26 'bbp_settings_users' => array( … … 83 85 */ 84 86 function bbp_admin_get_settings_fields() { 87 88 // Filter & return 85 89 return (array) apply_filters( 'bbp_admin_get_settings_fields', array( 86 90 … … 1755 1759 } 1756 1760 1757 // Allow plugins to further filter the output1761 // Filter & return 1758 1762 return apply_filters( 'bbp_get_form_option', $value, $option ); 1759 1763 } -
trunk/src/includes/admin/tools.php
r6393 r6438 458 458 */ 459 459 function bbp_get_tools_admin_pages() { 460 return apply_filters( 'bbp_tools_admin_tabs', array( 460 461 // Filter & return 462 return (array) apply_filters( 'bbp_tools_admin_tabs', array( 461 463 array( 462 464 'page' => 'bbp-repair', -
trunk/src/includes/admin/tools/common.php
r6415 r6438 22 22 } 23 23 24 /** 25 * Return the URL to run a specific repair tool 26 * 27 * @since 2.6.0 bbPress (r5885) 28 * 29 * @param string $component 30 */ 31 function bbp_get_admin_repair_tool_run_url( $component = array() ) { 32 $tools = admin_url( 'tools.php' ); 33 $page = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade'; 34 $args = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) ); 35 $url = add_query_arg( $args, $tools ); 36 $nonced = wp_nonce_url( $url, 'bbpress-do-counts' ); 37 38 return apply_filters( 'bbp_get_admin_repair_tool_run_url', $nonced, $component ); 39 } 24 /** 25 * Return the URL to run a specific repair tool 26 * 27 * @since 2.6.0 bbPress (r5885) 28 * 29 * @param string $component 30 */ 31 function bbp_get_admin_repair_tool_run_url( $component = array() ) { 32 $tools = admin_url( 'tools.php' ); 33 $page = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade'; 34 $args = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) ); 35 $url = add_query_arg( $args, $tools ); 36 $nonced = wp_nonce_url( $url, 'bbpress-do-counts' ); 37 38 // Filter & return 39 return apply_filters( 'bbp_get_admin_repair_tool_run_url', $nonced, $component ); 40 } 40 41 41 42 /** … … 174 175 } 175 176 177 // Filter & return 176 178 return apply_filters( 'bbp_get_admin_repair_tools', $tools, $type ); 177 179 } … … 198 200 } 199 201 202 // Filter & return 200 203 return apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval ); 201 204 } … … 380 383 ksort( $repair_list ); 381 384 385 // Filter & return 382 386 return (array) apply_filters( 'bbp_repair_list', $repair_list ); 383 387 } -
trunk/src/includes/admin/topics.php
r6424 r6438 840 840 */ 841 841 private function get_allowed_notice_toggles() { 842 return apply_filters( 'bbp_admin_topics_allowed_notice_toggles', array( 842 843 // Filter & return 844 return (array) apply_filters( 'bbp_admin_topics_allowed_notice_toggles', array( 843 845 'opened', 844 846 'closed', … … 861 863 */ 862 864 private function get_allowed_action_toggles() { 863 return apply_filters( 'bbp_admin_topics_allowed_action_toggles', array( 865 866 // Filter & return 867 return (array) apply_filters( 'bbp_admin_topics_allowed_action_toggles', array( 864 868 'bbp_toggle_topic_close', 865 869 'bbp_toggle_topic_stick', … … 891 895 ); 892 896 893 return apply_filters( 'bbp_admin_topics_column_headers', $columns ); 897 // Filter & return 898 return (array) apply_filters( 'bbp_admin_topics_column_headers', $columns ); 894 899 } 895 900 -
trunk/src/includes/common/ajax.php
r5951 r6438 38 38 $ajaxurl = add_query_arg( array( 'bbp-ajax' => 'true' ), $base_url ); 39 39 40 // Filter & return 40 41 return apply_filters( 'bbp_get_ajax_url', $ajaxurl ); 41 42 } -
trunk/src/includes/common/formatting.php
r6380 r6438 23 23 */ 24 24 function bbp_kses_allowed_tags() { 25 return apply_filters( 'bbp_kses_allowed_tags', array( 25 26 // Filter & return 27 return (array) apply_filters( 'bbp_kses_allowed_tags', array( 26 28 27 29 // Links … … 528 530 529 531 // Filter & return 530 return apply_filters( 'bbp_number_not_negative', $not_less_than_zero, $int, $number );532 return (int) apply_filters( 'bbp_number_not_negative', $not_less_than_zero, $int, $number ); 531 533 } 532 534 … … 549 551 } 550 552 553 // Filter & return 551 554 return apply_filters( 'bbp_number_format', number_format( $number, $decimals, $dec_point, $thousands_sep ), $number, $decimals, $dec_point, $thousands_sep ); 552 555 } … … 570 573 } 571 574 575 // Filter & return 572 576 return apply_filters( 'bbp_number_format_i18n', number_format_i18n( $number, $decimals ), $number, $decimals ); 573 577 } … … 593 597 $new_time = mysql2date( $d, $time, $translate ); 594 598 599 // Filter & return 595 600 return apply_filters( 'bbp_convert_date', $new_time, $d, $translate, $time ); 596 601 } … … 711 716 } 712 717 718 // Filter & return 713 719 return apply_filters( 'bbp_get_time_since', $output, $older_date, $newer_date ); 714 720 } -
trunk/src/includes/common/functions.php
r6437 r6438 24 24 */ 25 25 function bbp_get_redirect_to() { 26 $retval = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 27 26 27 // Check 'redirect_to' request parameter 28 $retval = ! empty( $_REQUEST['redirect_to'] ) 29 ? $_REQUEST['redirect_to'] 30 : ''; 31 32 // Filter & return 28 33 return apply_filters( 'bbp_get_redirect_to', $retval ); 29 34 } … … 44 49 45 50 // Are we appending the view=all vars? 46 if ( bbp_get_view_all() || ! empty( $force ) ) { 47 $link = add_query_arg( array( 'view' => 'all' ), $original_link ); 48 } else { 49 $link = $original_link; 50 } 51 51 $link = ( bbp_get_view_all() || ! empty( $force ) ) 52 ? add_query_arg( array( 'view' => 'all' ), $original_link ) 53 : $original_link; 54 55 // Filter & return 52 56 return apply_filters( 'bbp_add_view_all', $link, $original_link ); 53 57 } … … 65 69 */ 66 70 function bbp_remove_view_all( $original_link = '' ) { 67 return apply_filters( 'bbp_remove_view_all', remove_query_arg( 'view', $original_link ), $original_link ); 71 72 // Remove `view' argument 73 $link = remove_query_arg( 'view', $original_link ); 74 75 // Filter & return 76 return apply_filters( 'bbp_remove_view_all', $link, $original_link ); 68 77 } 69 78 … … 79 88 function bbp_get_view_all( $cap = 'moderate' ) { 80 89 $retval = ( ( ! empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) && current_user_can( $cap ) ) ); 90 91 // Filter & return 81 92 return apply_filters( 'bbp_get_view_all', (bool) $retval ); 82 93 } … … 192 203 } 193 204 205 // Filter & return 194 206 return apply_filters( 'bbp_past_edit_lock', (bool) $retval, $cur_time, $lock_time, $post_date_gmt ); 195 207 } … … 424 436 $statistics['hidden_reply_title'] = isset( $hidden_reply_title ) ? $hidden_reply_title : ''; 425 437 438 // Filter & return 426 439 return apply_filters( 'bbp_get_statistics', $statistics, $r ); 427 440 } … … 480 493 $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); 481 494 482 // Fi nally, return filtered anonymous post data495 // Filter & return 483 496 return (array) apply_filters( 'bbp_filter_anonymous_post_data', $r, $args ); 484 497 } … … 519 532 } 520 533 521 // Filter andreturn534 // Filter & return 522 535 return (array) apply_filters( 'bbp_sanitize_anonymous_post_author', $r, $anonymous_data ); 523 536 } … … 972 985 $sitename = substr( $sitename, 4 ); 973 986 } 987 988 // Filter & return 974 989 return apply_filters( 'bbp_get_do_not_reply_address', 'noreply@' . $sitename ); 975 990 } … … 1365 1380 } 1366 1381 1367 // Filter andreturn1382 // Filter & return 1368 1383 return apply_filters( 'bbp_logout_url', $url, $redirect_to ); 1369 1384 } … … 1515 1530 unset( $query ); 1516 1531 1517 // Filter andreturn1532 // Filter & return 1518 1533 return (int) apply_filters( 'bbp_get_public_child_last_id', $child_id, $parent_id, $post_type ); 1519 1534 } … … 1566 1581 unset( $query ); 1567 1582 1568 // Filter andreturn1583 // Filter & return 1569 1584 return (int) apply_filters( 'bbp_get_public_child_count', $child_count, $parent_id, $post_type ); 1570 1585 } … … 1617 1632 unset( $query ); 1618 1633 1619 // Filter andreturn1634 // Filter & return 1620 1635 return (array) apply_filters( 'bbp_get_public_child_ids', $child_ids, $parent_id, $post_type ); 1621 1636 } … … 1701 1716 $child_ids = wp_parse_id_list( $child_ids ); 1702 1717 1703 // Filter andreturn1718 // Filter & return 1704 1719 return (array) apply_filters( 'bbp_get_all_child_ids', $child_ids, $parent_id, $post_type ); 1705 1720 } … … 1726 1741 : ''; 1727 1742 1743 // Filter & return 1728 1744 return apply_filters( 'bbp_get_global_post_field', $retval, $post, $field, $context ); 1729 1745 } … … 2059 2075 } 2060 2076 2077 // Filter & return 2061 2078 return apply_filters( 'bbp_get_page_by_path', $retval, $path ); 2062 2079 } -
trunk/src/includes/common/shortcodes.php
r6415 r6438 175 175 $this->unset_globals(); 176 176 177 // Get the query name, for filter 178 $query_name = bbp_get_query_name(); 179 177 180 // Reset the query name 178 181 bbp_reset_query_name(); 179 182 180 183 // Return and flush the output buffer 181 return ob_get_clean(); 184 $output = ob_get_clean(); 185 186 // Filter & return 187 return apply_filters( 'bbp_display_shortcode', $output, $query_name ); 182 188 } 183 189 -
trunk/src/includes/common/template.php
r6433 r6438 112 112 $public = get_blog_option( $site_id, 'blog_public', 1 ); 113 113 114 // Filter & return 114 115 return (bool) apply_filters( 'bbp_is_site_public', $public, $site_id ); 115 116 } … … 134 135 } 135 136 137 // Filter & return 136 138 return (bool) apply_filters( 'bbp_is_forum', $retval, $post_id ); 137 139 } … … 158 160 } 159 161 162 // Filter & return 160 163 return (bool) apply_filters( 'bbp_is_forum_archive', $retval ); 161 164 } … … 188 191 } 189 192 193 // Filter & return 190 194 return (bool) apply_filters( 'bbp_is_single_forum', $retval ); 191 195 } … … 214 218 } 215 219 220 // Filter & return 216 221 return (bool) apply_filters( 'bbp_is_forum_edit', $retval ); 217 222 } … … 237 242 } 238 243 244 // Filter & return 239 245 return (bool) apply_filters( 'bbp_is_topic', $retval, $post_id ); 240 246 } … … 267 273 } 268 274 275 // Filter & return 269 276 return (bool) apply_filters( 'bbp_is_single_topic', $retval ); 270 277 } … … 290 297 } 291 298 299 // Filter & return 292 300 return (bool) apply_filters( 'bbp_is_topic_archive', $retval ); 293 301 } … … 316 324 } 317 325 326 // Filter & return 318 327 return (bool) apply_filters( 'bbp_is_topic_edit', $retval ); 319 328 } … … 337 346 } 338 347 348 // Filter & return 339 349 return (bool) apply_filters( 'bbp_is_topic_merge', $retval ); 340 350 } … … 358 368 } 359 369 370 // Filter & return 360 371 return (bool) apply_filters( 'bbp_is_topic_split', $retval ); 361 372 } … … 388 399 } 389 400 401 // Filter & return 390 402 return (bool) apply_filters( 'bbp_is_topic_tag', $retval ); 391 403 } … … 419 431 } 420 432 433 // Filter & return 421 434 return (bool) apply_filters( 'bbp_is_topic_tag_edit', $retval ); 422 435 } … … 449 462 } 450 463 464 // Filter & return 451 465 return (bool) apply_filters( 'bbp_is_custom_post_type', $retval, $the_post ); 452 466 } … … 472 486 } 473 487 488 // Filter & return 474 489 return (bool) apply_filters( 'bbp_is_reply', $retval, $post_id ); 475 490 } … … 498 513 } 499 514 515 // Filter & return 500 516 return (bool) apply_filters( 'bbp_is_reply_edit', $retval ); 501 517 } … … 517 533 } 518 534 535 // Filter & return 519 536 return (bool) apply_filters( 'bbp_is_reply_move', $retval ); 520 537 } … … 547 564 } 548 565 566 // Filter & return 549 567 return (bool) apply_filters( 'bbp_is_single_reply', $retval ); 550 568 } … … 568 586 } 569 587 588 // Filter & return 570 589 return (bool) apply_filters( 'bbp_is_favorites', $retval ); 571 590 } … … 589 608 } 590 609 610 // Filter & return 591 611 return (bool) apply_filters( 'bbp_is_subscriptions', $retval ); 592 612 } … … 611 631 } 612 632 633 // Filter & return 613 634 return (bool) apply_filters( 'bbp_is_topics_created', $retval ); 614 635 } … … 633 654 } 634 655 656 // Filter & return 635 657 return (bool) apply_filters( 'bbp_is_replies_created', $retval ); 636 658 } … … 658 680 } 659 681 682 // Filter & return 660 683 return (bool) apply_filters( 'bbp_is_user_home', $retval ); 661 684 } … … 681 704 } 682 705 706 // Filter & return 683 707 return (bool) apply_filters( 'bbp_is_user_home_edit', $retval ); 684 708 } … … 703 727 } 704 728 729 // Filter & return 705 730 return (bool) apply_filters( 'bbp_is_single_user', $retval ); 706 731 } … … 725 750 } 726 751 752 // Filter & return 727 753 return (bool) apply_filters( 'bbp_is_single_user_edit', $retval ); 728 754 } … … 747 773 } 748 774 775 // Filter & return 749 776 return (bool) apply_filters( 'bbp_is_single_user_profile', $retval ); 750 777 } … … 769 796 } 770 797 798 // Filter & return 771 799 return (bool) apply_filters( 'bbp_is_single_user_topics', $retval ); 772 800 } … … 791 819 } 792 820 821 // Filter & return 793 822 return (bool) apply_filters( 'bbp_is_single_user_replies', $retval ); 794 823 } … … 813 842 } 814 843 844 // Filter & return 815 845 return (bool) apply_filters( 'bbp_is_single_user_engagements', $retval ); 816 846 } … … 841 871 } 842 872 873 // Filter & return 843 874 return (bool) apply_filters( 'bbp_is_single_view', $retval ); 844 875 } … … 879 910 } 880 911 912 // Filter & return 881 913 return (bool) apply_filters( 'bbp_is_search', $retval ); 882 914 } … … 917 949 } 918 950 951 // Filter & return 919 952 return (bool) apply_filters( 'bbp_is_search_results', $retval ); 920 953 } … … 939 972 } 940 973 974 // Filter & return 941 975 return (bool) apply_filters( 'bbp_is_edit', $retval ); 942 976 } … … 1092 1126 $classes = apply_filters( 'bbp_get_the_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ); 1093 1127 1094 return apply_filters( 'bbp_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ); 1128 // Filter & return 1129 return (array) apply_filters( 'bbp_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ); 1095 1130 } 1096 1131 … … 1248 1283 1249 1284 // Add action as query arg 1250 if ( ! empty( $r['action'] ) ) { 1251 $login_url = add_query_arg( array( 'action' => $r['action'] ), $r['url'] ); 1252 1253 // No query arg 1254 } else { 1255 $login_url = $r['url']; 1256 } 1285 $login_url = ! empty( $r['action'] ) 1286 ? add_query_arg( array( 'action' => $r['action'] ), $r['url'] ) 1287 : $r['url']; 1257 1288 1258 1289 $login_url = site_url( $login_url, $r['context'] ); 1259 1290 1291 // Filter & return 1260 1292 return apply_filters( 'bbp_get_wp_login_action', $login_url, $r, $args ); 1261 1293 } … … 1290 1322 $redirect_field = '<input type="hidden" id="bbp_redirect_to" name="redirect_to" value="' . esc_url( $redirect_to ) . '" />'; 1291 1323 1324 // Filter & return 1292 1325 echo apply_filters( 'bbp_redirect_to_field', $redirect_field, $redirect_to ); 1293 1326 } … … 1351 1384 } 1352 1385 1386 // Filter & return 1353 1387 return apply_filters( 'bbp_get_sanitize_val', $retval, $request, $input_type ); 1354 1388 } … … 1397 1431 } 1398 1432 1433 // Filter & return 1399 1434 return apply_filters( 'bbp_get_tab_index', (int) $bbp->tab_index ); 1400 1435 } … … 1625 1660 } 1626 1661 1662 // Filter & return 1627 1663 return apply_filters( 'bbp_get_dropdown', $retval, $r ); 1628 1664 } … … 1939 1975 $output = ob_get_clean(); 1940 1976 1977 // Filter & return 1941 1978 return apply_filters( 'bbp_get_the_content', $output, $args, $post_content ); 1942 1979 } … … 1964 2001 $plugins[] = 'tabfocus'; 1965 2002 2003 // Filter & return 1966 2004 return apply_filters( 'bbp_get_tiny_mce_plugins', $plugins ); 1967 2005 } … … 1989 2027 array_push( $buttons, 'image' ); 1990 2028 2029 // Filter & return 1991 2030 return apply_filters( 'bbp_get_teeny_mce_buttons', $buttons ); 1992 2031 } … … 2016 2055 $settings['buttons'] = implode( ',', $buttons ); 2017 2056 2057 // Filter & return 2018 2058 return apply_filters( 'bbp_get_quicktags_settings', $settings ); 2019 2059 } … … 2143 2183 } 2144 2184 2185 // Filter & return 2145 2186 return apply_filters( 'bbp_get_view_link', $url, $view ); 2146 2187 } … … 2504 2545 $trail = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : ''; 2505 2546 2547 // Filter & return 2506 2548 return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r ); 2507 2549 } … … 2548 2590 } 2549 2591 2592 // Filter & return 2550 2593 return apply_filters( 'bbp_get_allowed_tags', htmlentities( $allowed ) ); 2551 2594 } … … 2641 2684 */ 2642 2685 function bbp_get_logout_link( $redirect_to = '' ) { 2643 return apply_filters( 'bbp_get_logout_link', '<a href="' . wp_logout_url( $redirect_to ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>', $redirect_to ); 2686 2687 // Build the link 2688 $link = '<a href="' . wp_logout_url( $redirect_to ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>'; 2689 2690 // Filter & return 2691 return apply_filters( 'bbp_get_logout_link', $link, $redirect_to ); 2644 2692 } 2645 2693 … … 2858 2906 } 2859 2907 2860 // Filter andreturn2908 // Filter & return 2861 2909 return apply_filters( 'bbp_title', $new_title, $sep, $seplocation ); 2862 2910 } -
trunk/src/includes/core/abstraction.php
r6243 r6438 103 103 */ 104 104 function bbp_get_root_url() { 105 106 // Filter & return 105 107 return apply_filters( 'bbp_get_root_url', bbp_rewrite()->root ); 106 108 } … … 114 116 */ 115 117 function bbp_get_paged_slug() { 118 119 // Filter & return 116 120 return apply_filters( 'bbp_get_paged_slug', bbp_rewrite()->pagination_base ); 117 121 } -
trunk/src/includes/core/capabilities.php
r6118 r6438 208 208 } 209 209 210 // Filter & return 210 211 return apply_filters( 'bbp_get_caps_for_role', $caps, $role ); 211 212 } … … 265 266 $all_roles = apply_filters( 'editable_roles', $the_roles ); 266 267 268 // Filter & return 267 269 return apply_filters( 'bbp_get_blog_roles', $all_roles, $wp_roles ); 268 270 } … … 395 397 : ''; 396 398 399 // Filter & return 397 400 return apply_filters( 'bbp_get_dynamic_role_name', $role, $role_id, $roles ); 398 401 } … … 436 439 */ 437 440 function bbp_get_keymaster_role() { 441 442 // Filter & return 438 443 return apply_filters( 'bbp_get_keymaster_role', 'bbp_keymaster' ); 439 444 } … … 448 453 */ 449 454 function bbp_get_moderator_role() { 455 456 // Filter & return 450 457 return apply_filters( 'bbp_get_moderator_role', 'bbp_moderator' ); 451 458 } … … 460 467 */ 461 468 function bbp_get_participant_role() { 469 470 // Filter & return 462 471 return apply_filters( 'bbp_get_participant_role', 'bbp_participant' ); 463 472 } … … 472 481 */ 473 482 function bbp_get_spectator_role() { 483 484 // Filter & return 474 485 return apply_filters( 'bbp_get_spectator_role', 'bbp_spectator' ); 475 486 } … … 484 495 */ 485 496 function bbp_get_blocked_role() { 497 498 // Filter & return 486 499 return apply_filters( 'bbp_get_blocked_role', 'bbp_blocked' ); 487 500 } -
trunk/src/includes/core/filters.php
r6431 r6438 342 342 */ 343 343 function _bbp_has_forums_query( $args = array() ) { 344 345 // Filter & return 344 346 return apply_filters( 'bbp_has_forums_query', $args ); 345 347 } … … 355 357 */ 356 358 function _bbp_has_topics_query( $args = array() ) { 359 360 // Filter & return 357 361 return apply_filters( 'bbp_has_topics_query', $args ); 358 362 } … … 368 372 */ 369 373 function _bbp_has_replies_query( $args = array() ) { 374 375 // Filter & return 370 376 return apply_filters( 'bbp_has_replies_query', $args ); 371 377 } -
trunk/src/includes/core/functions.php
r6353 r6438 284 284 : false; 285 285 286 // Filter & return 286 287 return apply_filters( 'bbp_get_view_query_args', $retval, $view ); 287 288 } … … 337 338 */ 338 339 function bbp_find_mentions_pattern() { 340 341 // Filter & return 339 342 return apply_filters( 'bbp_find_mentions_pattern', '/[@]+([A-Za-z0-9-_\.@]+)\b/' ); 340 343 } … … 359 362 } 360 363 364 // Filter & return 361 365 return apply_filters( 'bbp_find_mentions', $usernames, $pattern, $content ); 362 366 } -
trunk/src/includes/core/options.php
r6419 r6438 22 22 function bbp_get_default_options() { 23 23 24 // Default options24 // Filter & return 25 25 return apply_filters( 'bbp_get_default_options', array( 26 26 … … 216 216 */ 217 217 function bbp_is_favorites_active( $default = 1 ) { 218 219 // Filter & return 218 220 return (bool) apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', $default ) ); 219 221 } … … 229 231 */ 230 232 function bbp_is_subscriptions_active( $default = 1 ) { 233 234 // Filter & return 231 235 return (bool) apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) ); 232 236 } … … 242 246 */ 243 247 function bbp_is_engagements_active( $default = 1 ) { 248 249 // Filter & return 244 250 return (bool) apply_filters( 'bbp_is_engagements_active', (bool) get_option( '_bbp_enable_engagements', $default ) ); 245 251 } … … 255 261 */ 256 262 function bbp_allow_topic_tags( $default = 1 ) { 263 264 // Filter & return 257 265 return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) ); 258 266 } … … 269 277 */ 270 278 function bbp_allow_forum_mods( $default = 1 ) { 279 280 // Filter & return 271 281 return (bool) apply_filters( 'bbp_allow_forum_mods', (bool) get_option( '_bbp_allow_forum_mods', $default ) ); 272 282 } … … 282 292 */ 283 293 function bbp_allow_search( $default = 1 ) { 294 295 // Filter & return 284 296 return (bool) apply_filters( 'bbp_allow_search', (bool) get_option( '_bbp_allow_search', $default ) ); 285 297 } … … 295 307 */ 296 308 function bbp_allow_threaded_replies( $default = 0 ) { 309 310 // Filter & return 297 311 return (bool) apply_filters( '_bbp_allow_threaded_replies', (bool) get_option( '_bbp_allow_threaded_replies', $default ) ); 298 312 } … … 310 324 */ 311 325 function bbp_thread_replies_depth( $default = 2 ) { 326 327 // Filter & return 312 328 return (int) apply_filters( 'bbp_thread_replies_depth', (int) get_option( '_bbp_thread_replies_depth', $default ) ); 313 329 } … … 323 339 */ 324 340 function bbp_allow_revisions( $default = 1 ) { 341 342 // Filter & return 325 343 return (bool) apply_filters( 'bbp_allow_revisions', (bool) get_option( '_bbp_allow_revisions', $default ) ); 326 344 } … … 336 354 */ 337 355 function bbp_allow_anonymous( $default = 0 ) { 356 357 // Filter & return 338 358 return apply_filters( 'bbp_allow_anonymous', (bool) get_option( '_bbp_allow_anonymous', $default ) ); 339 359 } … … 349 369 */ 350 370 function bbp_allow_global_access( $default = 1 ) { 371 372 // Filter & return 351 373 return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) ); 352 374 } … … 362 384 */ 363 385 function bbp_get_default_role( $default = 'bbp_participant' ) { 386 387 // Filter & return 364 388 return apply_filters( 'bbp_get_default_role', get_option( '_bbp_default_role', $default ) ); 365 389 } … … 375 399 */ 376 400 function bbp_use_wp_editor( $default = 1 ) { 401 402 // Filter & return 377 403 return (bool) apply_filters( 'bbp_use_wp_editor', (bool) get_option( '_bbp_use_wp_editor', $default ) ); 378 404 } … … 388 414 */ 389 415 function bbp_use_autoembed( $default = 1 ) { 416 417 // Filter & return 390 418 return (bool) apply_filters( 'bbp_use_autoembed', (bool) get_option( '_bbp_use_autoembed', $default ) ); 391 419 } … … 401 429 */ 402 430 function bbp_get_theme_package_id( $default = 'default' ) { 431 432 // Filter & return 403 433 return apply_filters( 'bbp_get_theme_package_id', get_option( '_bbp_theme_package_id', $default ) ); 404 434 } … … 424 454 */ 425 455 function bbp_get_title_max_length( $default = 80 ) { 456 457 // Filter & return 426 458 return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) ); 427 459 } … … 447 479 */ 448 480 function bbp_get_group_forums_root_id( $default = 0 ) { 481 482 // Filter & return 449 483 return (int) apply_filters( 'bbp_get_group_forums_root_id', (int) get_option( '_bbp_group_forums_root_id', $default ) ); 450 484 } … … 460 494 */ 461 495 function bbp_is_group_forums_active( $default = 1 ) { 496 497 // Filter & return 462 498 return (bool) apply_filters( 'bbp_is_group_forums_active', (bool) get_option( '_bbp_enable_group_forums', $default ) ); 463 499 } … … 473 509 */ 474 510 function bbp_is_akismet_active( $default = 1 ) { 511 512 // Filter & return 475 513 return (bool) apply_filters( 'bbp_is_akismet_active', (bool) get_option( '_bbp_enable_akismet', $default ) ); 476 514 } … … 521 559 */ 522 560 function bbp_get_root_slug( $default = 'forums' ) { 561 562 // Filter & return 523 563 return apply_filters( 'bbp_get_root_slug', get_option( '_bbp_root_slug', $default ) ); 524 564 } … … 532 572 */ 533 573 function bbp_include_root_slug( $default = 1 ) { 574 575 // Filter & return 534 576 return (bool) apply_filters( 'bbp_include_root_slug', (bool) get_option( '_bbp_include_root', $default ) ); 535 577 } … … 543 585 */ 544 586 function bbp_show_on_root( $default = 'forums' ) { 587 588 // Filter & return 545 589 return apply_filters( 'bbp_show_on_root', get_option( '_bbp_show_on_root', $default ) ); 546 590 } … … 560 604 } 561 605 606 // Filter & return 562 607 return apply_filters( 'bbp_maybe_get_root_slug', $retval ); 563 608 } … … 571 616 */ 572 617 function bbp_get_forum_slug( $default = 'forum' ) { 618 619 // Filter & return 573 620 return apply_filters( 'bbp_get_forum_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_forum_slug', $default ) ); 574 621 } … … 582 629 */ 583 630 function bbp_get_topic_archive_slug( $default = 'topics' ) { 631 632 // Filter & return 584 633 return apply_filters( 'bbp_get_topic_archive_slug', get_option( '_bbp_topic_archive_slug', $default ) ); 585 634 } … … 593 642 */ 594 643 function bbp_get_reply_archive_slug( $default = 'replies' ) { 644 645 // Filter & return 595 646 return apply_filters( 'bbp_get_reply_archive_slug', get_option( '_bbp_reply_archive_slug', $default ) ); 596 647 } … … 604 655 */ 605 656 function bbp_get_topic_slug( $default = 'topic' ) { 657 658 // Filter & return 606 659 return apply_filters( 'bbp_get_topic_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_topic_slug', $default ) ); 607 660 } … … 615 668 */ 616 669 function bbp_get_topic_tag_tax_slug( $default = 'topic-tag' ) { 670 671 // Filter & return 617 672 return apply_filters( 'bbp_get_topic_tag_tax_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_topic_tag_slug', $default ) ); 618 673 } … … 626 681 */ 627 682 function bbp_get_reply_slug( $default = 'reply' ) { 683 684 // Filter & return 628 685 return apply_filters( 'bbp_get_reply_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_reply_slug', $default ) ); 629 686 } … … 637 694 */ 638 695 function bbp_get_user_slug( $default = 'users' ) { 696 697 // Filter & return 639 698 return apply_filters( 'bbp_get_user_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_user_slug', $default ) ); 640 699 } … … 648 707 */ 649 708 function bbp_get_user_favorites_slug( $default = 'favorites' ) { 709 710 // Filter & return 650 711 return apply_filters( 'bbp_get_user_favorites_slug', get_option( '_bbp_user_favs_slug', $default ) ); 651 712 } … … 659 720 */ 660 721 function bbp_get_user_subscriptions_slug( $default = 'subscriptions' ) { 722 723 // Filter & return 661 724 return apply_filters( 'bbp_get_user_subscriptions_slug', get_option( '_bbp_user_subs_slug', $default ) ); 662 725 } … … 670 733 */ 671 734 function bbp_get_user_engagements_slug( $default = 'engagements' ) { 735 736 // Filter & return 672 737 return apply_filters( 'bbp_get_user_engagements_slug', get_option( '_bbp_user_engagements_slug', $default ) ); 673 738 } … … 681 746 */ 682 747 function bbp_get_view_slug( $default = 'view' ) { 748 749 // Filter & return 683 750 return apply_filters( 'bbp_get_view_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_view_slug', $default ) ); 684 751 } … … 692 759 */ 693 760 function bbp_get_search_slug( $default = 'search' ) { 761 762 // Filter & return 694 763 return apply_filters( 'bbp_get_search_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_search_slug', $default ) ); 695 764 } … … 707 776 */ 708 777 function bbp_get_config_location( $default = '' ) { 778 779 // Filter & return 709 780 return apply_filters( 'bbp_get_config_location', get_option( 'bb-config-location', $default ) ); 710 781 } -
trunk/src/includes/core/sub-actions.php
r6302 r6438 468 468 */ 469 469 function bbp_plugin_locale( $locale = '', $domain = '' ) { 470 471 // Filter & return 470 472 return apply_filters( 'bbp_plugin_locale', $locale, $domain ); 471 473 } … … 480 482 */ 481 483 function bbp_request( $query_vars = array() ) { 484 485 // Filter & return 482 486 return apply_filters( 'bbp_request', $query_vars ); 483 487 } … … 494 498 */ 495 499 function bbp_template_include( $template = '' ) { 500 501 // Filter & return 496 502 return apply_filters( 'bbp_template_include', $template ); 497 503 } … … 516 522 * @since 2.0.0 bbPress (r2944) 517 523 * 524 * @param array $themes 518 525 * @uses apply_filters() Calls 'bbp_allowed_themes' with the allowed themes list 519 526 */ 520 527 function bbp_allowed_themes( $themes ) { 528 529 // Filter & return 521 530 return apply_filters( 'bbp_allowed_themes', $themes ); 522 531 } … … 533 542 */ 534 543 function bbp_map_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { 544 545 // Filter & return 535 546 return apply_filters( 'bbp_map_meta_caps', $caps, $cap, $user_id, $args ); 536 547 } -
trunk/src/includes/core/template-functions.php
r6320 r6438 353 353 $stack = array_unique( array_filter( $stack ) ); 354 354 355 // Filter & return 355 356 return (array) apply_filters( 'bbp_get_template_stack', $stack ) ; 356 357 } … … 412 413 $template = bbp_set_theme_compat_template( $template ); 413 414 415 // Filter & return 414 416 return apply_filters( "bbp_{$type}_template", $template ); 415 417 } … … 429 431 '' 430 432 ); 433 434 // Filter & return 431 435 return apply_filters( 'bbp_get_template_locations', $locations, $templates ); 432 436 } … … 453 457 } 454 458 459 // Filter & return 455 460 return apply_filters( 'bbp_add_template_stack_locations', array_unique( $retval ), $stacks ); 456 461 } -
trunk/src/includes/core/template-loader.php
r5951 r6438 115 115 } 116 116 117 // Filter & return 117 118 return apply_filters( 'bbp_template_include_theme_supports', $template ); 118 119 } -
trunk/src/includes/core/theme-compat.php
r6353 r6438 126 126 */ 127 127 function bbp_get_theme_compat_id() { 128 129 // Filter & return 128 130 return apply_filters( 'bbp_get_theme_compat_id', bbpress()->theme_compat->theme->id ); 129 131 } … … 141 143 */ 142 144 function bbp_get_theme_compat_name() { 145 146 // Filter & return 143 147 return apply_filters( 'bbp_get_theme_compat_name', bbpress()->theme_compat->theme->name ); 144 148 } 145 149 146 150 /** 147 * Gets the version of the bbPress compat able theme used, in the event the151 * Gets the version of the bbPress compatible theme used, in the event the 148 152 * currently active WordPress theme does not explicitly support bbPress. 149 153 * This can be filtered or set manually. Tricky theme authors can override the … … 156 160 */ 157 161 function bbp_get_theme_compat_version() { 162 163 // Filter & return 158 164 return apply_filters( 'bbp_get_theme_compat_version', bbpress()->theme_compat->theme->version ); 165 } 166 167 /** 168 * Gets the bbPress compatible theme used in the event the currently active 169 * WordPress theme does not explicitly support bbPress. This can be filtered, 170 * or set manually. Tricky theme authors can override the default and include 171 * their own bbPress compatibility layers for their themes. 172 * 173 * @since 2.0.0 bbPress (r3032) 174 * 175 * @uses apply_filters() 176 * @return string 177 */ 178 function bbp_get_theme_compat_dir() { 179 180 // Filter & return 181 return apply_filters( 'bbp_get_theme_compat_dir', bbpress()->theme_compat->theme->dir ); 159 182 } 160 183 … … 170 193 * @return string 171 194 */ 172 function bbp_get_theme_compat_dir() {173 return apply_filters( 'bbp_get_theme_compat_dir', bbpress()->theme_compat->theme->dir );174 }175 176 /**177 * Gets the bbPress compatable theme used in the event the currently active178 * WordPress theme does not explicitly support bbPress. This can be filtered,179 * or set manually. Tricky theme authors can override the default and include180 * their own bbPress compatibility layers for their themes.181 *182 * @since 2.0.0 bbPress (r3032)183 *184 * @uses apply_filters()185 * @return string186 */187 195 function bbp_get_theme_compat_url() { 196 197 // Filter & return 188 198 return apply_filters( 'bbp_get_theme_compat_url', bbpress()->theme_compat->theme->url ); 189 199 } … … 823 833 } 824 834 835 // Filter & return 825 836 return apply_filters( 'bbp_template_include_theme_compat', $template ); 826 837 } … … 1017 1028 } 1018 1029 1019 // Allow override of the override1030 // Filter & return 1020 1031 return (bool) apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type ); 1021 1032 } -
trunk/src/includes/extend/buddypress/functions.php
r6415 r6438 30 30 function bbp_get_component_name() { 31 31 32 // Use existing ID 33 if ( ! empty( bbpress()->extend->buddypress->id ) ) { 34 $retval = bbpress()->extend->buddypress->id; 35 36 // Use default 37 } else { 38 $retval = 'forums'; 39 } 40 32 // Use existing ID or default 33 $retval = ! empty( bbpress()->extend->buddypress->id ) 34 ? bbpress()->extend->buddypress->id 35 : 'forums'; 36 37 // Filter & return 41 38 return apply_filters( 'bbp_get_component_name', $retval ); 42 39 } … … 65 62 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) { 66 63 $bbp_user_id = $user_id; 67 }68 64 69 65 // Currently viewing or editing a user 70 elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) {66 } elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) { 71 67 $bbp_user_id = $did; 72 }73 68 74 69 // Maybe fallback on the current_user ID 75 elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) {70 } elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) { 76 71 $bbp_user_id = $lid; 77 72 } … … 81 76 82 77 /** 83 * Filter the bbPress is_single_user function with BuddyPress eq ivalent78 * Filter the bbPress is_single_user function with BuddyPress equivalent 84 79 * 85 80 * @since 2.1.0 bbPress (r3552) … … 97 92 98 93 /** 99 * Filter the bbPress is_user_home function with BuddyPress eq ivalent94 * Filter the bbPress is_user_home function with BuddyPress equivalent 100 95 * 101 96 * @since 2.1.0 bbPress (r3552) … … 578 573 $retval = (bool) ! empty( $group_ids ); 579 574 575 // Filter & return 580 576 return (bool) apply_filters( 'bbp_is_forum_group_forum', $retval, $forum_id, $group_ids ); 581 577 } … … 748 744 */ 749 745 function bbp_get_activity_actions() { 750 return apply_filters( 'bbp_get_activity_actions', array( 746 747 // Filter & return 748 return (array) apply_filters( 'bbp_get_activity_actions', array( 751 749 'topic' => __( '%1$s started the topic %2$s in the forum %3$s', 'bbpress' ), 752 750 'reply' => __( '%1$s replied to the topic %2$s in the forum %3$s', 'bbpress' ) -
trunk/src/includes/extend/buddypress/groups.php
r6433 r6438 293 293 } 294 294 295 return apply_filters( 'bbp_map_group_forum_topic_meta_caps', $caps, $cap, $user_id, $args ); 295 // Filter & return 296 return (array) apply_filters( 'bbp_map_group_forum_topic_meta_caps', $caps, $cap, $user_id, $args ); 296 297 } 297 298 -
trunk/src/includes/forums/capabilities.php
r6426 r6438 19 19 */ 20 20 function bbp_get_forum_caps() { 21 return apply_filters( 'bbp_get_forum_caps', array ( 21 22 // Filter & return 23 return (array) apply_filters( 'bbp_get_forum_caps', array ( 22 24 'edit_posts' => 'edit_forums', 23 25 'edit_others_posts' => 'edit_others_forums', … … 200 202 } 201 203 202 return apply_filters( 'bbp_map_forum_meta_caps', $caps, $cap, $user_id, $args ); 204 // Filter & return 205 return (array) apply_filters( 'bbp_map_forum_meta_caps', $caps, $cap, $user_id, $args ); 203 206 } 204 207 -
trunk/src/includes/forums/functions.php
r6434 r6438 83 83 do_action( 'bbp_insert_forum', (int) $forum_id ); 84 84 85 // Return new forum ID85 // Return forum_id 86 86 return $forum_id; 87 87 } … … 1167 1167 $forum_topic_count = (int) ( $total_topic_count + $difference ); 1168 1168 1169 // Filter & return 1169 1170 return (int) apply_filters( 'bbp_bump_forum_topic_count', $forum_topic_count, $forum_id, $difference, $update_ancestors ); 1170 1171 } … … 1267 1268 update_post_meta( $forum_id, '_bbp_topic_count_hidden', $new_count ); 1268 1269 1270 // Filter & return 1269 1271 return (int) apply_filters( 'bbp_bump_forum_topic_count_hidden', $new_count, $forum_id, $difference ); 1270 1272 } … … 1385 1387 $forum_reply_count = (int) ( $total_reply_count + $difference ); 1386 1388 1389 // Filter & return 1387 1390 return (int) apply_filters( 'bbp_bump_forum_reply_count', $forum_reply_count, $forum_id, $difference, $update_ancestors ); 1388 1391 } … … 1554 1557 } 1555 1558 1559 // Filter & return 1556 1560 return (int) apply_filters( 'bbp_update_forum_last_topic_id', $topic_id, $forum_id ); 1557 1561 } … … 1619 1623 } 1620 1624 1625 // Filter & return 1621 1626 return (int) apply_filters( 'bbp_update_forum_last_reply_id', $reply_id, $forum_id ); 1622 1627 } … … 1686 1691 } 1687 1692 1693 // Filter & return 1688 1694 return (int) apply_filters( 'bbp_update_forum_last_active_id', $active_id, $forum_id ); 1689 1695 } … … 1717 1723 } 1718 1724 1725 // Filter & return 1719 1726 return apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id ); 1720 1727 } … … 1740 1747 update_post_meta( $forum_id, '_bbp_forum_subforum_count', $subforums ); 1741 1748 1749 // Filter & return 1742 1750 return (int) apply_filters( 'bbp_update_forum_subforum_count', $subforums, $forum_id ); 1743 1751 } … … 1784 1792 update_post_meta( $forum_id, '_bbp_total_topic_count', $total_topics ); 1785 1793 1794 // Filter & return 1786 1795 return (int) apply_filters( 'bbp_update_forum_topic_count', $total_topics, $forum_id ); 1787 1796 } … … 1849 1858 } 1850 1859 1860 // Filter & return 1851 1861 return (int) apply_filters( 'bbp_update_forum_topic_count_hidden', $topic_count, $forum_id ); 1852 1862 } … … 1913 1923 update_post_meta( $forum_id, '_bbp_total_reply_count', $total_replies ); 1914 1924 1925 // Filter & return 1915 1926 return (int) apply_filters( 'bbp_update_forum_reply_count', $total_replies, $forum_id ); 1916 1927 } … … 2001 2012 */ 2002 2013 function bbp_get_forum_statuses( $forum_id = 0 ) { 2003 return apply_filters( 'bbp_get_forum_statuses', array( 2014 2015 // Filter & return 2016 return (array) apply_filters( 'bbp_get_forum_statuses', array( 2004 2017 'open' => _x( 'Open', 'Open the forum', 'bbpress' ), 2005 2018 'closed' => _x( 'Closed', 'Close the forum', 'bbpress' ) … … 2017 2030 */ 2018 2031 function bbp_get_forum_types( $forum_id = 0 ) { 2019 return apply_filters( 'bbp_get_forum_types', array( 2032 2033 // Filter & return 2034 return (array) apply_filters( 'bbp_get_forum_types', array( 2020 2035 'forum' => _x( 'Forum', 'Forum accepts new topics', 'bbpress' ), 2021 2036 'category' => _x( 'Category', 'Forum is a category', 'bbpress' ) … … 2033 2048 */ 2034 2049 function bbp_get_forum_visibilities( $forum_id = 0) { 2035 return apply_filters( 'bbp_get_forum_visibilities', array( 2050 2051 // Filter & return 2052 return (array) apply_filters( 'bbp_get_forum_visibilities', array( 2036 2053 bbp_get_public_status_id() => _x( 'Public', 'Make forum public', 'bbpress' ), 2037 2054 bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ), … … 2060 2077 : array(); 2061 2078 2062 return apply_filters( 'bbp_get_hidden_forum_ids', (array) $forum_ids ); 2079 // Filter & return 2080 return (array) apply_filters( 'bbp_get_hidden_forum_ids', $forum_ids ); 2063 2081 } 2064 2082 … … 2081 2099 : array(); 2082 2100 2083 return apply_filters( 'bbp_get_private_forum_ids', (array) $forum_ids ); 2101 // Filter & return 2102 return (array) apply_filters( 'bbp_get_private_forum_ids', $forum_ids ); 2084 2103 } 2085 2104 … … 2177 2196 } 2178 2197 2179 // Filter and return the results2198 // Filter & return 2180 2199 return apply_filters( 'bbp_exclude_forum_ids', $retval, $forum_ids, $type ); 2181 2200 } … … 2306 2325 $topic_ids = bbp_get_public_child_ids( $forum_id, bbp_get_topic_post_type() ); 2307 2326 2327 // Filter & return 2308 2328 return (array) apply_filters( 'bbp_forum_query_topic_ids', $topic_ids, $forum_id ); 2309 2329 } … … 2325 2345 $subforum_ids = bbp_get_all_child_ids( $forum_id, bbp_get_forum_post_type() ); 2326 2346 2347 // Filter & return 2327 2348 return (array) apply_filters( 'bbp_forum_query_subforum_ids', $subforum_ids, $forum_id ); 2328 2349 } … … 2373 2394 unset( $query ); 2374 2395 2396 // Filter & return 2375 2397 return (int) apply_filters( 'bbp_forum_query_last_reply_id', $reply_id, $forum_id ); 2376 2398 } -
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 } -
trunk/src/includes/replies/capabilities.php
r6384 r6438 19 19 */ 20 20 function bbp_get_reply_caps() { 21 return apply_filters( 'bbp_get_reply_caps', array ( 21 22 // Filter & return 23 return (array) apply_filters( 'bbp_get_reply_caps', array ( 22 24 'edit_posts' => 'edit_replies', 23 25 'edit_others_posts' => 'edit_others_replies', … … 207 209 } 208 210 209 return apply_filters( 'bbp_map_reply_meta_caps', $caps, $cap, $user_id, $args ); 211 // Filter & return 212 return (array) apply_filters( 'bbp_map_reply_meta_caps', $caps, $cap, $user_id, $args ); 210 213 } -
trunk/src/includes/replies/functions.php
r6415 r6438 77 77 do_action( 'bbp_insert_reply', (int) $reply_id, (int) $reply_meta['topic_id'], (int) $reply_meta['forum_id'] ); 78 78 79 // Return new reply ID79 // Return reply_id 80 80 return $reply_id; 81 81 } … … 1089 1089 $forum_id = bbp_update_forum_id( $reply_id, $forum_id ); 1090 1090 1091 // Filter & return 1091 1092 return (int) apply_filters( 'bbp_update_reply_forum_id', $forum_id, $reply_id ); 1092 1093 } … … 1138 1139 $topic_id = bbp_update_topic_id( $reply_id, $topic_id ); 1139 1140 1141 // Filter & return 1140 1142 return (int) apply_filters( 'bbp_update_reply_topic_id', $topic_id, $reply_id ); 1141 1143 } … … 1173 1175 } 1174 1176 1177 // Filter & return 1175 1178 return (int) apply_filters( 'bbp_update_reply_to', $reply_to, $reply_id ); 1176 1179 } … … 1222 1225 } 1223 1226 1227 // Filter & return 1224 1228 return (array) apply_filters( 'bbp_get_reply_ancestors', $ancestors, $reply_id ); 1225 1229 } … … 1264 1268 update_post_meta( $r['reply_id'], '_bbp_revision_log', $revision_log ); 1265 1269 1270 // Filter & return 1266 1271 return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $r['reply_id'] ); 1267 1272 } … … 1765 1770 */ 1766 1771 function bbp_get_reply_statuses( $reply_id = 0 ) { 1767 return apply_filters( 'bbp_get_reply_statuses', array( 1772 1773 // Filter & return 1774 return (array) apply_filters( 'bbp_get_reply_statuses', array( 1768 1775 bbp_get_public_status_id() => _x( 'Publish', 'Publish the reply', 'bbpress' ), 1769 1776 bbp_get_spam_status_id() => _x( 'Spam', 'Spam the reply', 'bbpress' ), … … 1783 1790 */ 1784 1791 function bbp_get_reply_toggles( $reply_id = 0 ) { 1785 return apply_filters( 'bbp_get_toggle_reply_actions', array( 1792 1793 // Filter & return 1794 return (array) apply_filters( 'bbp_get_toggle_reply_actions', array( 1786 1795 'bbp_toggle_reply_spam', 1787 1796 'bbp_toggle_reply_trash', … … 2115 2124 } 2116 2125 2117 // Filter andreturn2126 // Filter & return 2118 2127 return (int) apply_filters( 'bbp_get_replies_per_page', $retval, $default ); 2119 2128 } … … 2139 2148 } 2140 2149 2141 // Filter andreturn2150 // Filter & return 2142 2151 return (int) apply_filters( 'bbp_get_replies_per_rss_page', $retval, $default ); 2143 2152 } … … 2513 2522 } 2514 2523 2524 // Filter & return 2515 2525 return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow ); 2516 2526 } -
trunk/src/includes/replies/template.php
r6437 r6438 33 33 */ 34 34 function bbp_get_reply_post_type() { 35 36 // Filter & return 35 37 return apply_filters( 'bbp_get_reply_post_type', bbpress()->reply_post_type ); 36 38 } … … 44 46 */ 45 47 function bbp_get_reply_post_type_labels() { 46 return apply_filters( 'bbp_get_reply_post_type_labels', array( 48 49 // Filter & return 50 return (array) apply_filters( 'bbp_get_reply_post_type_labels', array( 47 51 'name' => __( 'Replies', 'bbpress' ), 48 52 'menu_name' => __( 'Replies', 'bbpress' ), … … 75 79 */ 76 80 function bbp_get_reply_post_type_rewrite() { 77 return apply_filters( 'bbp_get_reply_post_type_rewrite', array( 81 82 // Filter & return 83 return (array) apply_filters( 'bbp_get_reply_post_type_rewrite', array( 78 84 'slug' => bbp_get_reply_slug(), 79 85 'with_front' => false … … 89 95 */ 90 96 function bbp_get_reply_post_type_supports() { 91 return apply_filters( 'bbp_get_reply_post_type_supports', array( 97 98 // Filter & return 99 return (array) apply_filters( 'bbp_get_reply_post_type_supports', array( 92 100 'title', 93 101 'editor', … … 283 291 } 284 292 285 // Return object293 // Filter & return 286 294 return apply_filters( 'bbp_has_replies', $bbp->reply_query->have_posts(), $bbp->reply_query ); 287 295 } … … 379 387 } 380 388 389 // Filter & return 381 390 return (int) apply_filters( 'bbp_get_reply_id', $bbp_reply_id, $reply_id ); 382 391 } … … 422 431 } 423 432 433 // Filter & return 424 434 return apply_filters( 'bbp_get_reply', $reply, $output, $filter ); 425 435 } … … 451 461 $reply_id = bbp_get_reply_id( $reply_id ); 452 462 463 // Filter & return 453 464 return apply_filters( 'bbp_get_reply_permalink', get_permalink( $reply_id ), $reply_id ); 454 465 } … … 524 535 } 525 536 537 // Filter & return 526 538 return apply_filters( 'bbp_get_reply_url', $url, $reply_id, $redirect_to ); 527 539 } … … 555 567 $title = get_the_title( $reply_id ); 556 568 569 // Filter & return 557 570 return apply_filters( 'bbp_get_reply_title', $title, $reply_id ); 558 571 } … … 582 595 $reply_title = sprintf( __( 'Reply To: %s', 'bbpress' ), $topic_title ); 583 596 597 // Filter & return 584 598 return apply_filters( 'bbp_get_reply_title_fallback', $reply_title, $post_id, $topic_title ); 585 599 } … … 620 634 $content = get_post_field( 'post_content', $reply_id ); 621 635 636 // Filter & return 622 637 return apply_filters( 'bbp_get_reply_content', $content, $reply_id ); 623 638 } … … 673 688 } 674 689 690 // Filter & return 675 691 return apply_filters( 'bbp_get_reply_excerpt', $excerpt, $reply_id, $length ); 676 692 } … … 719 735 } 720 736 737 // Filter & return 721 738 return apply_filters( 'bbp_get_reply_post_date', $result, $reply_id, $humanize, $gmt, $date, $time ); 722 739 } … … 744 761 $reply_id = bbp_get_reply_id( $reply_id ); 745 762 763 // Filter & return 746 764 return apply_filters( 'bbp_reply_append_revisions', $content . bbp_get_reply_revision_log( $reply_id ), $content, $reply_id ); 747 765 } … … 827 845 $r .= "\n" . '</ul>' . "\n\n"; 828 846 847 // Filter & return 829 848 return apply_filters( 'bbp_get_reply_revision_log', $r, $reply_id ); 830 849 } … … 846 865 $revision_log = empty( $revision_log ) ? array() : $revision_log; 847 866 867 // Filter & return 848 868 return apply_filters( 'bbp_get_reply_raw_revision_log', $revision_log, $reply_id ); 849 869 } … … 865 885 $revisions = wp_get_post_revisions( $reply_id, array( 'order' => 'ASC' ) ); 866 886 887 // Filter & return 867 888 return apply_filters( 'bbp_get_reply_revisions', $revisions, $reply_id ); 868 889 } … … 914 935 function bbp_get_reply_status( $reply_id = 0 ) { 915 936 $reply_id = bbp_get_reply_id( $reply_id ); 937 938 // Filter & return 916 939 return apply_filters( 'bbp_get_reply_status', get_post_status( $reply_id ), $reply_id ); 917 940 } … … 932 955 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 933 956 957 // Filter & return 934 958 return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id ); 935 959 } … … 950 974 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 951 975 976 // Filter & return 952 977 return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id ); 953 978 } … … 968 993 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 969 994 995 // Filter & return 970 996 return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id ); 971 997 } … … 987 1013 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 988 1014 1015 // Filter & return 989 1016 return (bool) apply_filters( 'bbp_is_reply_pending', (bool) $reply_status, $reply_id ); 990 1017 } … … 1006 1033 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 1007 1034 1035 // Filter & return 1008 1036 return (bool) apply_filters( 'bbp_is_reply_private', (bool) $reply_status, $reply_id ); 1009 1037 } … … 1034 1062 } 1035 1063 1064 // Filter & return 1036 1065 return (bool) apply_filters( 'bbp_is_reply_anonymous', $retval, $reply_id ); 1037 1066 } … … 1080 1109 } 1081 1110 1111 // Filter & return 1082 1112 return apply_filters( 'bbp_get_reply_author', $author, $reply_id ); 1083 1113 } … … 1110 1140 $author_id = get_post_field( 'post_author', $reply_id ); 1111 1141 1142 // Filter & return 1112 1143 return (int) apply_filters( 'bbp_get_reply_author_id', $author_id, $reply_id ); 1113 1144 } … … 1172 1203 } 1173 1204 1205 // Filter & return 1174 1206 return apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id ); 1175 1207 } … … 1217 1249 } 1218 1250 1251 // Filter & return 1219 1252 return apply_filters( 'bbp_get_reply_author_avatar', $author_avatar, $reply_id, $size ); 1220 1253 } … … 1327 1360 } 1328 1361 1362 // Filter & return 1329 1363 return apply_filters( 'bbp_get_reply_author_link', $author_link, $r ); 1330 1364 } … … 1371 1405 } 1372 1406 1407 // Filter & return 1373 1408 return apply_filters( 'bbp_get_reply_author_url', $author_url, $reply_id ); 1374 1409 } … … 1424 1459 } 1425 1460 1461 // Filter & return 1426 1462 return apply_filters( 'bbp_get_reply_author_email', $author_email, $reply_id ); 1427 1463 } … … 1474 1510 } 1475 1511 1512 // Filter & return 1476 1513 return apply_filters( 'bbp_get_reply_author_role', $author_role, $r ); 1477 1514 } … … 1505 1542 $topic_id = bbp_get_reply_topic_id( $reply_id ); 1506 1543 1544 // Filter & return 1507 1545 return apply_filters( 'bbp_get_reply_topic_title', bbp_get_topic_title( $topic_id ), $reply_id ); 1508 1546 } … … 1546 1584 } 1547 1585 1586 // Filter & return 1548 1587 return (int) apply_filters( 'bbp_get_reply_topic_id', $topic_id, $reply_id ); 1549 1588 } … … 1586 1625 } 1587 1626 1627 // Filter & return 1588 1628 return (int) apply_filters( 'bbp_get_reply_forum_id', $forum_id, $reply_id ); 1589 1629 } … … 1664 1704 } 1665 1705 1706 // Filter & return 1666 1707 return (int) apply_filters( 'bbp_get_reply_to', $reply_to, $reply_id ); 1667 1708 } … … 1743 1784 $retval = $r['link_before'] . '<a role="button" href="' . esc_url( $r['uri'] ) . '" class="bbp-reply-to-link"' . $onclick . '>' . $r['reply_text'] . '</a>' . $r['link_after']; 1744 1785 1786 // Filter & return 1745 1787 return apply_filters( 'bbp_get_reply_to_link', $retval, $r, $args ); 1746 1788 } … … 1788 1830 $retval = sprintf( '<a href="%1$s" id="bbp-cancel-reply-to-link"%2$s>%3$s</a>', esc_url( $link ), $style, esc_html( $text ) ); 1789 1831 1832 // Filter & return 1790 1833 return apply_filters( 'bbp_get_cancel_reply_to_link', $retval, $link, $text ); 1791 1834 } … … 1856 1899 } 1857 1900 1901 // Filter & return 1858 1902 return (int) apply_filters( 'bbp_get_reply_position', $reply_position, $reply_id, $topic_id ); 1859 1903 } … … 1958 2002 $retval = $r['before'] . $links . $r['after']; 1959 2003 2004 // Filter & return 1960 2005 return apply_filters( 'bbp_get_reply_admin_links', $retval, $r, $args ); 1961 2006 } … … 2024 2069 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after']; 2025 2070 2071 // Filter & return 2026 2072 return apply_filters( 'bbp_get_reply_edit_link', $retval, $r, $args ); 2027 2073 } … … 2079 2125 $url = bbp_add_view_all( $url ); 2080 2126 2127 // Filter & return 2081 2128 return apply_filters( 'bbp_get_reply_edit_url', $url, $reply_id ); 2082 2129 } … … 2162 2209 $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; 2163 2210 2211 // Filter & return 2164 2212 return apply_filters( 'bbp_get_reply_trash_link', $retval, $r, $args ); 2165 2213 } … … 2225 2273 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-spam-link">' . $display . '</a>' . $r['link_after']; 2226 2274 2275 // Filter & return 2227 2276 return apply_filters( 'bbp_get_reply_spam_link', $retval, $r, $args ); 2228 2277 } … … 2295 2344 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-reply-move-link">' . $r['split_text'] . '</a>' . $r['link_after']; 2296 2345 2346 // Filter & return 2297 2347 return apply_filters( 'bbp_get_reply_move_link', $retval, $r, $args ); 2298 2348 } … … 2365 2415 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after']; 2366 2416 2417 // Filter & return 2367 2418 return apply_filters( 'bbp_get_topic_split_link', $retval, $r, $args ); 2368 2419 } … … 2428 2479 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-approve-link">' . $display . '</a>' . $r['link_after']; 2429 2480 2481 // Filter & return 2430 2482 return apply_filters( 'bbp_get_reply_approve_link', $retval, $r, $args ); 2431 2483 } … … 2547 2599 } 2548 2600 2549 // Filter andreturn2601 // Filter & return 2550 2602 return apply_filters( 'bbp_get_topic_pagination_count', $retstr ); 2551 2603 } … … 2577 2629 } 2578 2630 2631 // Filter & return 2579 2632 return apply_filters( 'bbp_get_topic_pagination_links', $bbp->reply_query->pagination_links ); 2580 2633 } … … 2616 2669 } 2617 2670 2671 // Filter & return 2618 2672 return apply_filters( 'bbp_get_form_reply_content', $reply_content ); 2619 2673 } … … 2654 2708 } 2655 2709 2710 // Filter & return 2656 2711 return apply_filters( 'bbp_get_form_reply_to', $reply_to ); 2657 2712 } … … 2743 2798 ) ); 2744 2799 2745 // Filter andreturn2800 // Filter & return 2746 2801 return apply_filters( 'bbp_get_reply_to_dropdown', $retval, $reply_id, $reply_to, $topic_id ); 2747 2802 } … … 2780 2835 $checked = checked( $reply_revision, true, false ); 2781 2836 2837 // Filter & return 2782 2838 return apply_filters( 'bbp_get_form_reply_log_edit', $checked, $reply_revision ); 2783 2839 } … … 2813 2869 } 2814 2870 2871 // Filter & return 2815 2872 return apply_filters( 'bbp_get_form_reply_edit_reason', $reply_edit_reason ); 2816 2873 } … … 2893 2950 <?php 2894 2951 2895 // Return the results2952 // Filter & return 2896 2953 return apply_filters( 'bbp_get_form_reply_status_dropdown', ob_get_clean(), $r ); 2897 2954 } -
trunk/src/includes/search/functions.php
r5951 r6438 50 50 // Get search terms 51 51 $search_terms = bbp_get_search_terms(); 52 $retval = ! empty( $search_terms ) ? array( 's' => $search_terms ) : array(); 52 $retval = ! empty( $search_terms ) 53 ? array( 's' => $search_terms ) 54 : array(); 53 55 56 // Filter & return 54 57 return apply_filters( 'bbp_get_search_query_args', $retval ); 55 58 } -
trunk/src/includes/search/template.php
r6414 r6438 160 160 } 161 161 162 // Return object162 // Filter & return 163 163 return apply_filters( 'bbp_has_search_results', $bbp->search_query->have_posts(), $bbp->search_query ); 164 164 } … … 237 237 } 238 238 239 // Filter & return 239 240 return apply_filters( 'bbp_get_search_title', $title, $search_terms ); 240 241 } … … 277 278 } 278 279 280 // Filter & return 279 281 return apply_filters( 'bbp_get_search_url', $url ); 280 282 } … … 329 331 } 330 332 333 // Filter & return 331 334 return apply_filters( 'bbp_get_search_results_url', $url ); 332 335 } … … 371 374 $search_terms = ! empty( $search_terms ) ? urldecode( trim( $search_terms ) ) : false; 372 375 376 // Filter & return 373 377 return apply_filters( 'bbp_get_search_terms', $search_terms, $passed_terms ); 374 378 } … … 423 427 } 424 428 425 // Filter andreturn429 // Filter & return 426 430 return apply_filters( 'bbp_get_search_pagination_count', esc_html( $retstr ) ); 427 431 } … … 454 458 } 455 459 460 // Filter & return 456 461 return apply_filters( 'bbp_get_search_pagination_links', $bbp->search_query->pagination_links ); 457 462 } -
trunk/src/includes/topics/capabilities.php
r6384 r6438 19 19 */ 20 20 function bbp_get_topic_caps() { 21 return apply_filters( 'bbp_get_topic_caps', array ( 21 22 // Filter & return 23 return (array) apply_filters( 'bbp_get_topic_caps', array ( 22 24 'edit_posts' => 'edit_topics', 23 25 'edit_others_posts' => 'edit_others_topics', … … 39 41 */ 40 42 function bbp_get_topic_tag_caps() { 41 return apply_filters( 'bbp_get_topic_tag_caps', array ( 43 44 // Filter & return 45 return (array) apply_filters( 'bbp_get_topic_tag_caps', array ( 42 46 'manage_terms' => 'manage_topic_tags', 43 47 'edit_terms' => 'edit_topic_tags', … … 225 229 } 226 230 227 return apply_filters( 'bbp_map_topic_meta_caps', $caps, $cap, $user_id, $args ); 231 // Filter & return 232 return (array) apply_filters( 'bbp_map_topic_meta_caps', $caps, $cap, $user_id, $args ); 228 233 } 229 234 … … 256 261 } 257 262 258 return apply_filters( 'bbp_map_topic_tag_meta_caps', $caps, $cap, $user_id, $args ); 259 } 263 // Filter & return 264 return (array) apply_filters( 'bbp_map_topic_tag_meta_caps', $caps, $cap, $user_id, $args ); 265 } -
trunk/src/includes/topics/functions.php
r6415 r6438 81 81 do_action( 'bbp_insert_topic', (int) $topic_id, (int) $topic_meta['forum_id'] ); 82 82 83 // Return new topic ID83 // Return topic_id 84 84 return $topic_id; 85 85 } … … 2019 2019 */ 2020 2020 function bbp_get_topic_statuses( $topic_id = 0 ) { 2021 return apply_filters( 'bbp_get_topic_statuses', array( 2021 2022 // Filter & return 2023 return (array) apply_filters( 'bbp_get_topic_statuses', array( 2022 2024 bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ), 2023 2025 bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ), … … 2038 2040 */ 2039 2041 function bbp_get_topic_types( $topic_id = 0 ) { 2040 return apply_filters( 'bbp_get_topic_types', array( 2042 2043 // Filter & return 2044 return (array) apply_filters( 'bbp_get_topic_types', array( 2041 2045 'unstick' => _x( 'Normal', 'Unstick a topic', 'bbpress' ), 2042 2046 'stick' => _x( 'Sticky', 'Make topic sticky', 'bbpress' ), … … 2055 2059 */ 2056 2060 function bbp_get_topic_toggles( $topic_id = 0 ) { 2057 return apply_filters( 'bbp_get_toggle_topic_actions', array( 2061 2062 // Filter & return 2063 return (array) apply_filters( 'bbp_get_toggle_topic_actions', array( 2058 2064 'bbp_toggle_topic_close', 2059 2065 'bbp_toggle_topic_stick', … … 2089 2095 : wp_parse_id_list( $stickies ); 2090 2096 2091 // Filter andreturn2097 // Filter & return 2092 2098 return (array) apply_filters( 'bbp_get_stickies', $stickies, $forum_id ); 2093 2099 } … … 2112 2118 : wp_parse_id_list( $stickies ); 2113 2119 2114 // Filter andreturn2120 // Filter & return 2115 2121 return (array) apply_filters( 'bbp_get_super_stickies', $stickies ); 2116 2122 } … … 2473 2479 update_post_meta( $topic_id, '_bbp_reply_count', $new_count ); 2474 2480 2481 // Filter & return 2475 2482 return (int) apply_filters( 'bbp_bump_topic_reply_count', $new_count, $topic_id, $difference ); 2476 2483 } … … 2572 2579 update_post_meta( $topic_id, '_bbp_reply_count_hidden', $new_count ); 2573 2580 2581 // Filter & return 2574 2582 return (int) apply_filters( 'bbp_bump_topic_reply_count_hidden', $new_count, $topic_id, $difference ); 2575 2583 } … … 2695 2703 update_post_meta( $topic_id, '_bbp_forum_id', $forum_id ); 2696 2704 2705 // Filter & return 2697 2706 return (int) apply_filters( 'bbp_update_topic_forum_id', $forum_id, $topic_id ); 2698 2707 } … … 2714 2723 update_post_meta( $topic_id, '_bbp_topic_id', $topic_id ); 2715 2724 2725 // Filter & return 2716 2726 return apply_filters( 'bbp_update_topic_topic_id', $topic_id ); 2717 2727 } … … 2752 2762 update_post_meta( $topic_id, '_bbp_reply_count', $reply_count ); 2753 2763 2764 // Filter & return 2754 2765 return (int) apply_filters( 'bbp_update_topic_reply_count', $reply_count, $topic_id ); 2755 2766 } … … 2799 2810 update_post_meta( $topic_id, '_bbp_reply_count_hidden', $reply_count ); 2800 2811 2812 // Filter & return 2801 2813 return (int) apply_filters( 'bbp_update_topic_reply_count_hidden', $reply_count, $topic_id ); 2802 2814 } … … 2845 2857 } 2846 2858 2859 // Filter & return 2847 2860 return (int) apply_filters( 'bbp_update_topic_last_active_id', $active_id, $topic_id ); 2848 2861 } … … 2883 2896 } 2884 2897 2898 // Filter & return 2885 2899 return apply_filters( 'bbp_update_topic_last_active_time', $new_time, $topic_id ); 2886 2900 } … … 2931 2945 } 2932 2946 2947 // Filter & return 2933 2948 return (int) apply_filters( 'bbp_update_topic_last_reply_id', $reply_id, $topic_id ); 2934 2949 } … … 2989 3004 update_post_meta( $topic_id, '_bbp_voice_count', $count ); 2990 3005 3006 // Filter & return 2991 3007 return (int) apply_filters( 'bbp_update_topic_voice_count', $count, $topic_id ); 2992 3008 } … … 3029 3045 update_post_meta( $topic_id, '_bbp_anonymous_reply_count', $replies ); 3030 3046 3047 // Filter & return 3031 3048 return (int) apply_filters( 'bbp_update_topic_anonymous_reply_count', $replies, $topic_id ); 3032 3049 } … … 3942 3959 } 3943 3960 3944 // Filter andreturn3961 // Filter & return 3945 3962 return (int) apply_filters( 'bbp_get_topics_per_page', $retval, $default ); 3946 3963 } … … 3966 3983 } 3967 3984 3968 // Filter andreturn3985 // Filter & return 3969 3986 return (int) apply_filters( 'bbp_get_topics_per_rss_page', $retval, $default ); 3970 3987 } … … 3986 4003 $topic_tags = array_filter( $terms ); 3987 4004 4005 // Filter & return 3988 4006 return apply_filters( 'bbp_get_topic_tags', $topic_tags, $topic_id ); 3989 4007 } … … 4002 4020 $topic_tags = bbp_get_topic_tags( $topic_id ); 4003 4021 $pluck = wp_list_pluck( $topic_tags, 'name' ); 4004 $terms = ! empty( $pluck ) ? implode( $sep, $pluck ) : ''; 4005 4022 $terms = ! empty( $pluck ) 4023 ? implode( $sep, $pluck ) 4024 : ''; 4025 4026 // Filter & return 4006 4027 return apply_filters( 'bbp_get_topic_tag_names', $terms, $topic_id, $sep ); 4007 4028 } -
trunk/src/includes/topics/template.php
r6433 r6438 33 33 */ 34 34 function bbp_get_topic_post_type() { 35 36 // Filter & return 35 37 return apply_filters( 'bbp_get_topic_post_type', bbpress()->topic_post_type ); 36 38 } … … 44 46 */ 45 47 function bbp_get_topic_post_type_labels() { 46 return apply_filters( 'bbp_get_topic_post_type_labels', array( 48 49 // Filter & return 50 return (array) apply_filters( 'bbp_get_topic_post_type_labels', array( 47 51 'name' => __( 'Topics', 'bbpress' ), 48 52 'menu_name' => __( 'Topics', 'bbpress' ), … … 75 79 */ 76 80 function bbp_get_topic_post_type_rewrite() { 77 return apply_filters( 'bbp_get_topic_post_type_rewrite', array( 81 82 // Filter & return 83 return (array) apply_filters( 'bbp_get_topic_post_type_rewrite', array( 78 84 'slug' => bbp_get_topic_slug(), 79 85 'with_front' => false … … 89 95 */ 90 96 function bbp_get_topic_post_type_supports() { 91 return apply_filters( 'bbp_get_topic_post_type_supports', array( 97 98 // Filter & return 99 return (array) apply_filters( 'bbp_get_topic_post_type_supports', array( 92 100 'title', 93 101 'editor', … … 113 121 } 114 122 123 // Filter & return 115 124 return (bool) apply_filters( 'bbp_show_lead_topic', (bool) $show_lead ); 116 125 } … … 265 274 } 266 275 267 // Return object276 // Filter & return 268 277 return apply_filters( 'bbp_has_topics', $bbp->topic_query->have_posts(), $bbp->topic_query ); 269 278 } … … 502 511 } 503 512 513 // Filter & return 504 514 return (int) apply_filters( 'bbp_get_topic_id', (int) $bbp_topic_id, $topic_id ); 505 515 } … … 549 559 } 550 560 561 // Filter & return 551 562 return apply_filters( 'bbp_get_topic', $topic, $output, $filter ); 552 563 } … … 592 603 } 593 604 605 // Filter & return 594 606 return apply_filters( 'bbp_get_topic_permalink', $topic_permalink, $topic_id ); 595 607 } … … 622 634 $title = get_the_title( $topic_id ); 623 635 636 // Filter & return 624 637 return apply_filters( 'bbp_get_topic_title', $title, $topic_id ); 625 638 } … … 668 681 } 669 682 683 // Filter & return 670 684 return apply_filters( 'bbp_get_topic_archive_title', $title ); 671 685 } … … 706 720 $content = get_post_field( 'post_content', $topic_id ); 707 721 722 // Filter & return 708 723 return apply_filters( 'bbp_get_topic_content', $content, $topic_id ); 709 724 } … … 759 774 } 760 775 776 // Filter & return 761 777 return apply_filters( 'bbp_get_topic_excerpt', $excerpt, $topic_id, $length ); 762 778 } … … 805 821 } 806 822 823 // Filter & return 807 824 return apply_filters( 'bbp_get_topic_post_date', $result, $topic_id, $humanize, $gmt, $date, $time ); 808 825 } … … 901 918 } 902 919 920 // Filter & return 903 921 return apply_filters( 'bbp_get_topic_pagination', $pagination_links, $args ); 904 922 } … … 926 944 $topic_id = bbp_get_topic_id( $topic_id ); 927 945 946 // Filter & return 928 947 return apply_filters( 'bbp_topic_append_revisions', $content . bbp_get_topic_revision_log( $topic_id ), $content, $topic_id ); 929 948 } … … 999 1018 $retval .= "\n" . '</ul>' . "\n\n"; 1000 1019 1020 // Filter & return 1001 1021 return apply_filters( 'bbp_get_topic_revision_log', $retval, $topic_id ); 1002 1022 } … … 1019 1039 $revision_log = empty( $revision_log ) ? array() : $revision_log; 1020 1040 1041 // Filter & return 1021 1042 return apply_filters( 'bbp_get_topic_raw_revision_log', $revision_log, $topic_id ); 1022 1043 } … … 1038 1059 $revisions = wp_get_post_revisions( $topic_id, array( 'order' => 'ASC' ) ); 1039 1060 1061 // Filter & return 1040 1062 return apply_filters( 'bbp_get_topic_revisions', $revisions, $topic_id ); 1041 1063 } … … 1088 1110 } 1089 1111 1112 // Filter & return 1090 1113 return (bool) apply_filters( 'bbp_is_topic_sticky', $retval, $topic_id, $check_super ); 1091 1114 } … … 1104 1127 $topic_id = bbp_get_topic_id( $topic_id ); 1105 1128 $stickies = bbp_get_super_stickies( $topic_id ); 1106 $retval = in_array( $topic_id, $stickies ); 1107 1129 $retval = in_array( $topic_id, $stickies, true ); 1130 1131 // Filter & return 1108 1132 return (bool) apply_filters( 'bbp_is_topic_super_sticky', $retval, $topic_id ); 1109 1133 } … … 1135 1159 $topic_id = bbp_get_topic_id( $topic_id ); 1136 1160 1161 // Filter & return 1137 1162 return apply_filters( 'bbp_get_topic_status', get_post_status( $topic_id ), $topic_id ); 1138 1163 } … … 1149 1174 */ 1150 1175 function bbp_get_public_topic_statuses() { 1151 $statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() ); 1152 1176 $statuses = array( 1177 bbp_get_public_status_id(), 1178 bbp_get_closed_status_id() 1179 ); 1180 1181 // Filter & return 1153 1182 return (array) apply_filters( 'bbp_get_public_topic_statuses', $statuses ); 1154 1183 } … … 1168 1197 $topic_id = bbp_get_topic_id( $topic_id ); 1169 1198 $status = bbp_get_closed_status_id(); 1170 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1171 1172 return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $topic_status, $topic_id ); 1199 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1200 1201 // Filter & return 1202 return (bool) apply_filters( 'bbp_is_topic_closed', $topic_status, $topic_id ); 1173 1203 } 1174 1204 … … 1205 1235 $is_public = in_array( $status, $public, true ); 1206 1236 1207 return (bool) apply_filters( 'bbp_is_topic_public', (bool) $is_public, $topic_id ); 1237 // Filter & return 1238 return (bool) apply_filters( 'bbp_is_topic_public', $is_public, $topic_id ); 1208 1239 } 1209 1240 … … 1222 1253 $topic_id = bbp_get_topic_id( $topic_id ); 1223 1254 $status = bbp_get_public_status_id(); 1224 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1225 1226 return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id ); 1255 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1256 1257 // Filter & return 1258 return (bool) apply_filters( 'bbp_is_topic_published', $topic_status, $topic_id ); 1227 1259 } 1228 1260 … … 1241 1273 $topic_id = bbp_get_topic_id( $topic_id ); 1242 1274 $status = bbp_get_spam_status_id(); 1243 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1244 1245 return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id ); 1275 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1276 1277 // Filter & return 1278 return (bool) apply_filters( 'bbp_is_topic_spam', $topic_status, $topic_id ); 1246 1279 } 1247 1280 … … 1260 1293 $topic_id = bbp_get_topic_id( $topic_id ); 1261 1294 $status = bbp_get_trash_status_id(); 1262 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1263 1264 return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id ); 1295 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1296 1297 // Filter & return 1298 return (bool) apply_filters( 'bbp_is_topic_trash', $topic_status, $topic_id ); 1265 1299 } 1266 1300 … … 1279 1313 $topic_id = bbp_get_topic_id( $topic_id ); 1280 1314 $status = bbp_get_pending_status_id(); 1281 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1282 1283 return (bool) apply_filters( 'bbp_is_topic_pending', (bool) $topic_status, $topic_id ); 1315 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1316 1317 // Filter & return 1318 return (bool) apply_filters( 'bbp_is_topic_pending', $topic_status, $topic_id ); 1284 1319 } 1285 1320 … … 1298 1333 $topic_id = bbp_get_topic_id( $topic_id ); 1299 1334 $status = bbp_get_private_status_id(); 1300 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1301 1302 return (bool) apply_filters( 'bbp_is_topic_private', (bool) $topic_status, $topic_id ); 1335 $topic_status = ( bbp_get_topic_status( $topic_id ) === $status ); 1336 1337 // Filter & return 1338 return (bool) apply_filters( 'bbp_is_topic_private', $topic_status, $topic_id ); 1303 1339 } 1304 1340 … … 1329 1365 } 1330 1366 1331 // The topic is by an anonymous user1367 // Filter & return 1332 1368 return (bool) apply_filters( 'bbp_is_topic_anonymous', $retval, $topic_id ); 1333 1369 } … … 1377 1413 } 1378 1414 1415 // Filter & return 1379 1416 return apply_filters( 'bbp_get_topic_author', $author, $topic_id ); 1380 1417 } … … 1407 1444 $author_id = get_post_field( 'post_author', $topic_id ); 1408 1445 1446 // Filter & return 1409 1447 return (int) apply_filters( 'bbp_get_topic_author_id', (int) $author_id, $topic_id ); 1410 1448 } … … 1470 1508 } 1471 1509 1510 // Filter & return 1472 1511 return apply_filters( 'bbp_get_topic_author_display_name', $author_name, $topic_id ); 1473 1512 } … … 1514 1553 } 1515 1554 1555 // Filter & return 1516 1556 return apply_filters( 'bbp_get_topic_author_avatar', $author_avatar, $topic_id, $size ); 1517 1557 } … … 1627 1667 } 1628 1668 1669 // Filter & return 1629 1670 return apply_filters( 'bbp_get_topic_author_link', $author_link, $args ); 1630 1671 } … … 1674 1715 } 1675 1716 1717 // Filter & return 1676 1718 return apply_filters( 'bbp_get_topic_author_url', $author_url, $topic_id ); 1677 1719 } … … 1727 1769 } 1728 1770 1771 // Filter & return 1729 1772 return apply_filters( 'bbp_get_topic_author_email', $author_email, $topic_id ); 1730 1773 } … … 1777 1820 } 1778 1821 1822 // Filter & return 1779 1823 return apply_filters( 'bbp_get_topic_author_role', $author_role, $r ); 1780 1824 } … … 1808 1852 $forum_id = bbp_get_topic_forum_id( $topic_id ); 1809 1853 1854 // Filter & return 1810 1855 return apply_filters( 'bbp_get_topic_forum', bbp_get_forum_title( $forum_id ), $topic_id, $forum_id ); 1811 1856 } … … 1838 1883 $forum_id = get_post_meta( $topic_id, '_bbp_forum_id', true ); 1839 1884 1885 // Filter & return 1840 1886 return (int) apply_filters( 'bbp_get_topic_forum_id', (int) $forum_id, $topic_id ); 1841 1887 } … … 1868 1914 $active_id = get_post_meta( $topic_id, '_bbp_last_active_id', true ); 1869 1915 1916 // Filter & return 1870 1917 return (int) apply_filters( 'bbp_get_topic_last_active_id', (int) $active_id, $topic_id ); 1871 1918 } … … 1914 1961 $last_active = ! empty( $last_active ) ? bbp_get_time_since( bbp_convert_date( $last_active ) ) : ''; 1915 1962 1916 // Return the time since1963 // Filter & return 1917 1964 return apply_filters( 'bbp_get_topic_last_active', $last_active, $topic_id ); 1918 1965 } … … 1968 2015 $retval = bbp_get_user_subscribe_link( $r ); 1969 2016 2017 // Filter & return 1970 2018 return apply_filters( 'bbp_get_topic_subscribe_link', $retval, $r, $args ); 1971 2019 } … … 2021 2069 $retval = bbp_get_user_favorites_link( $r ); 2022 2070 2071 // Filter & return 2023 2072 return apply_filters( 'bbp_get_topic_favorite_link', $retval, $r, $args ); 2024 2073 } … … 2053 2102 $reply_id = get_post_meta( $topic_id, '_bbp_last_reply_id', true ); 2054 2103 2104 // Filter & return 2055 2105 return (int) apply_filters( 'bbp_get_topic_last_reply_id', (int) $reply_id, $topic_id ); 2056 2106 } … … 2089 2139 $retval = apply_filters( 'bbp_get_topic_last_topic_title', $retval, $topic_id, $reply_id ); 2090 2140 2141 // Filter & return 2091 2142 return apply_filters( 'bbp_get_topic_last_reply_title', $retval, $topic_id, $reply_id ); 2092 2143 } … … 2121 2172 $retval = bbp_get_reply_permalink( $reply_id ); 2122 2173 2174 // Filter & return 2123 2175 return apply_filters( 'bbp_get_topic_last_reply_permalink', $retval, $topic_id, $reply_id ); 2124 2176 } … … 2159 2211 } 2160 2212 2213 // Filter & return 2161 2214 return apply_filters( 'bbp_get_topic_last_reply_url', $reply_url, $topic_id, $reply_id ); 2162 2215 } … … 2201 2254 } 2202 2255 2256 // Filter & return 2203 2257 return apply_filters( 'bbp_get_topic_freshness_link', $anchor, $topic_id, $time_since, $link_url, $title ); 2204 2258 } … … 2258 2312 } 2259 2313 2314 // Filter & return 2260 2315 return apply_filters( 'bbp_get_topic_replies_link', $retval, $topic_id ); 2261 2316 } … … 2595 2650 $retval = $r['before'] . $links . $r['after']; 2596 2651 2652 // Filter & return 2597 2653 return apply_filters( 'bbp_get_topic_admin_links', $retval, $r, $args ); 2598 2654 } … … 2661 2717 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after']; 2662 2718 2719 // Filter & return 2663 2720 return apply_filters( 'bbp_get_topic_edit_link', $retval, $r, $args ); 2664 2721 } … … 2715 2772 $url = bbp_add_view_all( $url ); 2716 2773 2774 // Filter & return 2717 2775 return apply_filters( 'bbp_get_topic_edit_url', $url, $topic_id ); 2718 2776 } … … 2793 2851 $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; 2794 2852 2853 // Filter & return 2795 2854 return apply_filters( 'bbp_get_topic_trash_link', $retval, $r, $args ); 2796 2855 } … … 2855 2914 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-close-link">' . $display . '</a>' . $r['link_after']; 2856 2915 2916 // Filter & return 2857 2917 return apply_filters( 'bbp_get_topic_close_link', $retval, $r, $args ); 2858 2918 } … … 2918 2978 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-approve-link">' . $display . '</a>' . $r['link_after']; 2919 2979 2980 // Filter & return 2920 2981 return apply_filters( 'bbp_get_topic_approve_link', $retval, $r, $args ); 2921 2982 } … … 2997 3058 $retval = $r['link_before'] . $stick_display . $super_display . $r['link_after']; 2998 3059 3060 // Filter & return 2999 3061 return apply_filters( 'bbp_get_topic_stick_link', $retval, $r, $args ); 3000 3062 } … … 3052 3114 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after']; 3053 3115 3116 // Filter & return 3054 3117 return apply_filters( 'bbp_get_topic_merge_link', $retval, $r, $args ); 3055 3118 } … … 3112 3175 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-spam-link">' . $display . '</a>' . $r['link_after']; 3113 3176 3177 // Filter & return 3114 3178 return apply_filters( 'bbp_get_topic_spam_link', $retval, $r, $args ); 3115 3179 } … … 3162 3226 $retval = $r['link_before'] . '<a role="button" href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after']; 3163 3227 3228 // Filter & return 3164 3229 return apply_filters( 'bbp_get_topic_reply_link', $retval, $r, $args ); 3165 3230 } … … 3233 3298 } 3234 3299 3300 // Filter & return 3235 3301 return apply_filters( 'bbp_get_topics_pagination_base', $base ); 3236 3302 } … … 3279 3345 } 3280 3346 3281 // Filter andreturn3347 // Filter & return 3282 3348 return apply_filters( 'bbp_get_forum_pagination_count', $retstr ); 3283 3349 } … … 3308 3374 } 3309 3375 3376 // Filter & return 3310 3377 return apply_filters( 'bbp_get_forum_pagination_links', $bbp->topic_query->pagination_links ); 3311 3378 } … … 3464 3531 <?php 3465 3532 3466 // Return the results3533 // Filter & return 3467 3534 return apply_filters( 'bbp_get_form_topic_type_dropdown', ob_get_clean(), $r, $args ); 3468 3535 } … … 3545 3612 <?php 3546 3613 3547 // Return the results3614 // Filter & return 3548 3615 return apply_filters( 'bbp_get_form_topic_status_dropdown', ob_get_clean(), $r, $args ); 3549 3616 } … … 3630 3697 $retstr = $r['before'] . $retstr . $r['after']; 3631 3698 3632 // Return filtered result3699 // Filter & return 3633 3700 return apply_filters( 'bbp_get_single_topic_description', $retstr, $r, $args ); 3634 3701 } … … 3655 3722 */ 3656 3723 function bbp_get_topic_tag_tax_id() { 3724 3725 // Filter & return 3657 3726 return apply_filters( 'bbp_get_topic_tag_tax_id', bbpress()->topic_tag_tax_id ); 3658 3727 } … … 3666 3735 */ 3667 3736 function bbp_get_topic_tag_tax_labels() { 3668 return apply_filters( 'bbp_get_topic_tag_tax_labels', array( 3737 3738 // Filter & return 3739 return (array) apply_filters( 'bbp_get_topic_tag_tax_labels', array( 3669 3740 'name' => __( 'Topic Tags', 'bbpress' ), 3670 3741 'singular_name' => __( 'Topic Tag', 'bbpress' ), … … 3692 3763 */ 3693 3764 function bbp_get_topic_tag_tax_rewrite() { 3694 return apply_filters( 'bbp_get_topic_tag_tax_rewrite', array( 3765 3766 // Filter & return 3767 return (array) apply_filters( 'bbp_get_topic_tag_tax_rewrite', array( 3695 3768 'slug' => bbp_get_topic_tag_tax_slug(), 3696 3769 'with_front' => false … … 3735 3808 : 0; 3736 3809 3810 // Filter & return 3737 3811 return (int) apply_filters( 'bbp_get_topic_tag_id', (int) $retval, $tag, $term ); 3738 3812 } … … 3775 3849 : ''; 3776 3850 3851 // Filter & return 3777 3852 return apply_filters( 'bbp_get_topic_tag_name', $retval, $tag, $term ); 3778 3853 } … … 3815 3890 : ''; 3816 3891 3892 // Filter & return 3817 3893 return apply_filters( 'bbp_get_topic_tag_slug', $retval, $tag, $term ); 3818 3894 } … … 3855 3931 : ''; 3856 3932 3933 // Filter & return 3857 3934 return apply_filters( 'bbp_get_topic_tag_link', $retval, $tag, $term ); 3858 3935 } … … 3903 3980 } 3904 3981 3982 // Filter & return 3905 3983 return apply_filters( 'bbp_get_topic_tag_edit_link', $retval, $tag, $term ); 3906 3984 } … … 3951 4029 : ''; 3952 4030 4031 // Filter & return 3953 4032 return apply_filters( 'bbp_get_topic_tag_description', $retval, $r, $args, $tag, $term ); 3954 4033 } … … 3990 4069 } 3991 4070 4071 // Filter & return 3992 4072 return apply_filters( 'bbp_get_form_topic_title', $topic_title ); 3993 4073 } … … 4027 4107 } 4028 4108 4109 // Filter & return 4029 4110 return apply_filters( 'bbp_get_form_topic_content', $topic_content ); 4030 4111 } … … 4104 4185 } 4105 4186 4187 // Filter & return 4106 4188 return apply_filters( 'bbp_get_form_topic_tags', $topic_tags ); 4107 4189 } … … 4142 4224 } 4143 4225 4226 // Filter & return 4144 4227 return apply_filters( 'bbp_get_form_topic_forum', $topic_forum ); 4145 4228 } … … 4200 4283 $checked = checked( $topic_subscribed, true, false ); 4201 4284 4285 // Filter & return 4202 4286 return apply_filters( 'bbp_get_form_topic_subscribed', $checked, $topic_subscribed ); 4203 4287 } … … 4236 4320 $checked = checked( $topic_revision, true, false ); 4237 4321 4322 // Filter & return 4238 4323 return apply_filters( 'bbp_get_form_topic_log_edit', $checked, $topic_revision ); 4239 4324 } … … 4269 4354 } 4270 4355 4356 // Filter & return 4271 4357 return apply_filters( 'bbp_get_form_topic_edit_reason', $topic_edit_reason ); 4272 4358 } … … 4337 4423 } 4338 4424 4425 // Filter & return 4339 4426 return (bool) apply_filters( 'bbp_show_topic_lock_alert', $retval, $topic_id ); 4340 4427 } … … 4369 4456 $text = sprintf( esc_html__( '%1$s is currently editing this topic.', 'bbpress' ), $person ); 4370 4457 4458 // Filter & return 4371 4459 return apply_filters( 'bbp_get_topic_lock_description', $text, $user_id, $topic_id ); 4372 4460 } -
trunk/src/includes/users/capabilities.php
r6384 r6438 118 118 } 119 119 120 return apply_filters( 'bbp_map_primary_meta_caps', $caps, $cap, $user_id, $args ); 120 // Filter & return 121 return (array) apply_filters( 'bbp_map_primary_meta_caps', $caps, $cap, $user_id, $args ); 121 122 } 122 123 … … 167 168 } 168 169 170 // Filter & return 169 171 return apply_filters( 'bbp_set_user_role', $new_role, $user_id, $user ); 170 172 } … … 205 207 } 206 208 209 // Filter & return 207 210 return apply_filters( 'bbp_get_user_role', $role, $user_id, $user ); 208 211 } … … 243 246 } 244 247 248 // Filter & return 245 249 return apply_filters( 'bbp_get_user_blog_role', $role, $user_id, $user ); 246 250 } … … 393 397 $default_role = bbp_get_default_role(); 394 398 395 // Return filtered results, forcing admins to keymasters.399 // Filter & return 396 400 return (array) apply_filters( 'bbp_get_user_role_map', array ( 397 401 'administrator' => bbp_get_keymaster_role(), … … 440 444 } 441 445 446 // Filter & return 442 447 return (bool) apply_filters( 'bbp_core_is_user_spammer', $is_spammer ); 443 448 } … … 661 666 } 662 667 668 // Filter & return 663 669 return (bool) apply_filters( 'bbp_core_is_user_deleted', $is_deleted ); 664 670 } … … 744 750 $_user_id = (int) ! empty( $user_id ) ? $user_id : bbp_get_current_user_id(); 745 751 746 // Filter andreturn752 // Filter & return 747 753 return (bool) apply_filters( 'bbp_is_user_keymaster', user_can( $_user_id, 'keep_gate' ), $_user_id, $user_id ); 748 754 } … … 783 789 } 784 790 785 // Filter andreturn791 // Filter & return 786 792 return (bool) apply_filters( 'bbp_show_user_profile', $retval, $user_id ); 787 793 } … … 855 861 } 856 862 857 return apply_filters( 'bbp_get_moderators', $users, $object_id ); 858 } 863 // Filter & return 864 return (array) apply_filters( 'bbp_get_moderators', $users, $object_id ); 865 } -
trunk/src/includes/users/engagements.php
r6422 r6438 32 32 $retval = add_metadata( $meta_type, $object_id, $meta_key, $user_id, false ); 33 33 34 // Filter & return 34 35 return (bool) apply_filters( 'bbp_add_user_to_object', (bool) $retval, $object_id, $user_id, $meta_key, $meta_type ); 35 36 } … … 54 55 $retval = delete_metadata( $meta_type, $object_id, $meta_key, $user_id, false ); 55 56 57 // Filter & return 56 58 return (bool) apply_filters( 'bbp_remove_user_from_object', (bool) $retval, $object_id, $user_id, $meta_key, $meta_type ); 57 59 } … … 75 77 $retval = wp_parse_id_list( $meta ); 76 78 77 return (array) apply_filters( 'bbp_get_users_for_object', (array) $retval, $object_id, $meta_key, $meta_type ); 79 // Filter & return 80 return (array) apply_filters( 'bbp_get_users_for_object', $retval, $object_id, $meta_key, $meta_type ); 78 81 } 79 82 … … 98 101 $retval = is_numeric( array_search( $user_id, $user_ids, true ) ); 99 102 100 return (bool) apply_filters( 'bbp_is_object_of_user', (bool) $retval, $object_id, $user_id, $meta_key, $meta_type ); 103 // Filter & return 104 return (bool) apply_filters( 'bbp_is_object_of_user', $retval, $object_id, $user_id, $meta_key, $meta_type ); 101 105 } 102 106 … … 118 122 $users = bbp_get_users_for_object( $topic_id, '_bbp_engagement' ); 119 123 124 // Filter & return 120 125 return (array) apply_filters( 'bbp_get_topic_engagements', $users, $topic_id ); 121 126 } … … 144 149 ) ); 145 150 151 // Filter & return 146 152 return apply_filters( 'bbp_get_user_engagements', $engagements, $user_id ); 147 153 } … … 173 179 ) ); 174 180 181 // Filter & return 175 182 return (array) apply_filters( 'bbp_get_user_engaged_topic_ids', $engagements->posts, $user_id ); 176 183 } … … 195 202 $retval = bbp_is_object_of_user( $topic_id, $user_id, '_bbp_engagement' ); 196 203 204 // Filter & return 197 205 return (bool) apply_filters( 'bbp_is_user_engaged', (bool) $retval, $user_id, $topic_id ); 198 206 } … … 288 296 $users = bbp_get_users_for_object( $topic_id, '_bbp_favorite' ); 289 297 298 // Filter & return 290 299 return (array) apply_filters( 'bbp_get_topic_favoriters', $users, $topic_id ); 291 300 } … … 314 323 ) ); 315 324 325 // Filter & return 316 326 return apply_filters( 'bbp_get_user_favorites', $query, $user_id ); 317 327 } … … 343 353 ) ); 344 354 355 // Filter & return 345 356 return (array) apply_filters( 'bbp_get_user_favorites_topic_ids', $favorites->posts, $user_id ); 346 357 } … … 389 400 } 390 401 402 // Filter & return 391 403 return (bool) apply_filters( 'bbp_is_user_favorite', (bool) $retval, $user_id, $topic_id, $favorites ); 392 404 } … … 585 597 $users = bbp_get_users_for_object( $forum_id, '_bbp_subscription' ); 586 598 599 // Filter & return 587 600 return (array) apply_filters( 'bbp_get_forum_subscribers', $users, $forum_id ); 588 601 } … … 602 615 $users = bbp_get_users_for_object( $topic_id, '_bbp_subscription' ); 603 616 617 // Filter & return 604 618 return (array) apply_filters( 'bbp_get_topic_subscribers', $users, $topic_id ); 605 619 } … … 619 633 _deprecated_function( __FUNCTION__, 2.5, 'bbp_get_user_topic_subscriptions()' ); 620 634 $query = bbp_get_user_topic_subscriptions( $user_id ); 635 636 // Filter & return 621 637 return apply_filters( 'bbp_get_user_subscriptions', $query, $user_id ); 622 638 } … … 645 661 ) ); 646 662 663 // Filter & return 647 664 return apply_filters( 'bbp_get_user_topic_subscriptions', $query, $user_id ); 648 665 } … … 671 688 ) ); 672 689 690 // Filter & return 673 691 return apply_filters( 'bbp_get_user_forum_subscriptions', $query, $user_id ); 674 692 } … … 700 718 ) ); 701 719 720 // Filter & return 702 721 return (array) apply_filters( 'bbp_get_user_subscribed_forum_ids', $subscriptions->posts, $user_id ); 703 722 } … … 729 748 ) ); 730 749 750 // Filter & return 731 751 return (array) apply_filters( 'bbp_get_user_subscribed_topic_ids', $subscriptions->posts, $user_id ); 732 752 } … … 783 803 } 784 804 805 // Filter & return 785 806 return (bool) apply_filters( 'bbp_is_user_subscribed', $retval, $user_id, $object_id, $subscribed_ids ); 786 807 } … … 840 861 } 841 862 863 // Filter & return 842 864 return (bool) apply_filters( 'bbp_is_user_subscribed_to_forum', (bool) $retval, $user_id, $forum_id, $subscribed_ids ); 843 865 } … … 897 919 } 898 920 921 // Filter & return 899 922 return (bool) apply_filters( 'bbp_is_user_subscribed_to_topic', (bool) $retval, $user_id, $topic_id, $subscribed_ids ); 900 923 } -
trunk/src/includes/users/functions.php
r6422 r6438 40 40 } 41 41 42 // Filter & return 42 43 return apply_filters( 'bbp_redirect_login', $url, $raw_url, $user ); 43 44 } … … 55 56 */ 56 57 function bbp_is_anonymous() { 57 if ( ! is_user_logged_in() && bbp_allow_anonymous() ) { 58 $is_anonymous = true; 59 } else { 60 $is_anonymous = false; 61 } 62 63 return apply_filters( 'bbp_is_anonymous', $is_anonymous ); 58 $is_anonymous = ( ! is_user_logged_in() && bbp_allow_anonymous() ); 59 60 // Filter & return 61 return (bool) apply_filters( 'bbp_is_anonymous', $is_anonymous ); 64 62 } 65 63 … … 167 165 $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $remote_address ); 168 166 167 // Filter & return 169 168 return apply_filters( 'bbp_current_author_ip', $retval, $remote_address ); 170 169 } … … 182 181 : ''; 183 182 183 // Filter & return 184 184 return apply_filters( 'bbp_current_author_ua', $retval ); 185 185 } … … 553 553 ) ); 554 554 555 // Filter & return 555 556 return apply_filters( 'bbp_get_user_topics_started', $query, $user_id ); 556 557 } … … 581 582 ) ); 582 583 584 // Filter & return 583 585 return apply_filters( 'bbp_get_user_replies_created', $query, $user_id ); 584 586 } … … 595 597 function bbp_get_total_users() { 596 598 $user_count = count_users(); 597 return apply_filters( 'bbp_get_total_users', (int) $user_count['total_users'] ); 599 600 // Filter & return 601 return (int) apply_filters( 'bbp_get_total_users', (int) $user_count['total_users'] ); 598 602 } 599 603 … … 632 636 } 633 637 634 return apply_filters( 'bbp_get_user_ids_from_nicenames', $retval, $user_nicenames ); 638 // Filter & return 639 return (array) apply_filters( 'bbp_get_user_ids_from_nicenames', $retval, $user_nicenames ); 635 640 } 636 641 … … 664 669 } 665 670 666 return apply_filters( 'bbp_get_user_nicenames_from_ids', $retval, $user_ids ); 671 // Filter & return 672 return (array) apply_filters( 'bbp_get_user_nicenames_from_ids', $retval, $user_ids ); 667 673 } 668 674 … … 693 699 $count = $count + bbp_get_user_closed_topic_count( $user_id ); 694 700 701 // Filter & return 695 702 return (int) apply_filters( 'bbp_get_user_topic_count_raw', $count, $user_id ); 696 703 } … … 718 725 $count = count_user_posts( $user_id, bbp_get_reply_post_type(), false ); 719 726 727 // Filter & return 720 728 return (int) apply_filters( 'bbp_get_user_reply_count_raw', $count, $user_id ); 721 729 } … … 748 756 ) ); 749 757 758 // Filter & return 750 759 return (int) apply_filters( 'bbp_get_user_closed_topic_count', $count, $user_id ); 751 760 } -
trunk/src/includes/users/options.php
r6359 r6438 20 20 function bbp_get_default_user_options() { 21 21 22 // Default options23 return apply_filters( 'bbp_get_default_user_options', array(22 // Filter & return 23 return (array) apply_filters( 'bbp_get_default_user_options', array( 24 24 '_bbp_last_posted' => '0', // For checking flooding 25 25 '_bbp_topic_count' => '0', // Total topics per site … … 225 225 : 'bbp_get_user_topic_count'; 226 226 227 // Filter & return 227 228 return apply_filters( $filter, $count, $user_id ); 228 229 } … … 369 370 $time = get_user_option( '_bbp_last_posted', $user_id ); 370 371 372 // Filter & return 371 373 return apply_filters( 'bbp_get_user_last_posted', $time, $user_id ); 372 374 } -
trunk/src/includes/users/template.php
r6427 r6438 191 191 $bbp->user_query = new BBP_User_Query( $r ); 192 192 193 // Filter & return 193 194 return apply_filters( 'bbp_has_users', $bbp->user_query->have_users(), $bbp->user_query ); 194 195 } … … 270 271 } 271 272 273 // Filter & return 272 274 return (int) apply_filters( 'bbp_get_user_id', (int) $bbp_user_id, $displayed_user_fallback, $current_user_fallback ); 273 275 } … … 293 295 */ 294 296 function bbp_get_current_user_id() { 295 return apply_filters( 'bbp_get_current_user_id', bbp_get_user_id( 0, false, true ) ); 297 298 // Filter & return 299 return (int) apply_filters( 'bbp_get_current_user_id', bbp_get_user_id( 0, false, true ) ); 296 300 } 297 301 … … 316 320 */ 317 321 function bbp_get_displayed_user_id() { 322 323 // Filter & return 318 324 return apply_filters( 'bbp_get_displayed_user_id', bbp_get_user_id( 0, true, false ) ); 319 325 } … … 368 374 $user->filter = $old_filter; 369 375 370 // Return empty376 // Filter & return 371 377 return apply_filters( 'bbp_get_displayed_user_field', $value, $field, $filter ); 372 378 } … … 394 400 global $user_identity; 395 401 396 $current_user_name = is_user_logged_in() ? $user_identity : __( 'Anonymous', 'bbpress' ); 397 402 $current_user_name = is_user_logged_in() 403 ? $user_identity 404 : esc_html__( 'Anonymous', 'bbpress' ); 405 406 // Filter & return 398 407 return apply_filters( 'bbp_get_current_user_name', $current_user_name ); 399 408 } … … 434 443 $avatar = get_avatar( $user, $size ); 435 444 445 // Filter & return 436 446 return apply_filters( 'bbp_get_current_user_avatar', $avatar, $size ); 437 447 } … … 472 482 $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 473 483 484 // Filter & return 474 485 return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id ); 475 486 } … … 524 535 $retval = ! empty( $nicename ) ? ( $r['before'] . $nicename . $r['after'] ) : ''; 525 536 526 // Filter andreturn537 // Filter & return 527 538 return (string) apply_filters( 'bbp_get_user_nicename', $retval, $user_id, $r ); 528 539 } … … 588 599 } 589 600 601 // Filter & return 590 602 return apply_filters( 'bbp_get_user_profile_url', $url, $user_id, $user_nicename ); 591 603 } … … 625 637 $user = get_userdata( $user_id ); 626 638 $edit_link = '<a href="' . esc_url( bbp_get_user_profile_edit_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 639 640 // Filter & return 627 641 return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id ); 628 642 } … … 684 698 } 685 699 700 // Filter & return 686 701 return apply_filters( 'bbp_get_user_edit_profile_url', $url, $user_id, $user_nicename ); 687 688 702 } 689 703 … … 736 750 } 737 751 752 // Filter & return 738 753 return apply_filters( 'bbp_get_user_display_role', $role, $user_id ); 739 754 } … … 784 799 $retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after']; 785 800 801 // Filter & return 786 802 return apply_filters( 'bbp_get_admin_link', $retval, $r ); 787 803 } … … 831 847 } 832 848 849 // Filter & return 833 850 return apply_filters( 'bbp_get_author_ip', $author_ip, $r ); 834 851 } … … 889 906 } 890 907 908 // Filter & return 891 909 return apply_filters( 'bbp_get_author_display_name', $retval, $post_id ); 892 910 } … … 945 963 } 946 964 965 // Filter & return 947 966 return apply_filters( 'bbp_get_author_email', $retval, $post_id ); 948 967 } … … 1001 1020 } 1002 1021 1022 // Filter & return 1003 1023 return apply_filters( 'bbp_get_author_url', $retval, $post_id ); 1004 1024 } … … 1080 1100 } 1081 1101 1102 // Filter & return 1082 1103 return apply_filters( 'bbp_get_favorites_permalink', $url, $user_id ); 1083 1104 } … … 1191 1212 } 1192 1213 1193 // Return the link1214 // Filter & return 1194 1215 return apply_filters( 'bbp_get_user_favorites_link', $html, $r, $user_id, $topic_id ); 1195 1216 } … … 1281 1302 } 1282 1303 1304 // Filter & return 1283 1305 return apply_filters( 'bbp_get_subscriptions_permalink', $url, $user_id ); 1284 1306 } … … 1435 1457 } 1436 1458 1437 // Return the link1459 // Filter & return 1438 1460 return apply_filters( 'bbp_get_user_subscribe_link', $html, $r, $user_id, $topic_id ); 1439 1461 } … … 1603 1625 function bbp_edit_user_blog_role() { 1604 1626 1605 // Returnif no user is being edited1627 // Bail if no user is being edited 1606 1628 if ( ! bbp_is_single_user_edit() ) { 1607 1629 return; … … 1635 1657 function bbp_edit_user_forums_role() { 1636 1658 1637 // Returnif no user is being edited1659 // Bail if no user is being edited 1638 1660 if ( ! bbp_is_single_user_edit() ) { 1639 1661 return; … … 1679 1701 $contact_methods = wp_get_user_contact_methods( bbpress()->displayed_user ); 1680 1702 1681 return apply_filters( 'bbp_edit_user_contact_methods', $contact_methods ); 1703 // Filter & return 1704 return (array) apply_filters( 'bbp_edit_user_contact_methods', $contact_methods ); 1682 1705 } 1683 1706 … … 1735 1758 } 1736 1759 1760 // Filter & return 1737 1761 return apply_filters( 'bbp_get_user_topics_created_url', $url, $user_id ); 1738 1762 } … … 1791 1815 } 1792 1816 1817 // Filter & return 1793 1818 return apply_filters( 'bbp_get_user_replies_created_url', $url, $user_id ); 1794 1819 } … … 1847 1872 } 1848 1873 1874 // Filter & return 1849 1875 return apply_filters( 'bbp_get_user_engagements_url', $url, $user_id ); 1850 1876 } … … 2105 2131 } 2106 2132 2133 // Filter & return 2107 2134 return apply_filters( 'bbp_get_author_link', $author_link, $r ); 2108 2135 } … … 2157 2184 2158 2185 // Forum is hidden, and user can see it 2159 } elseif ( bbp_is_forum_hidden 2186 } elseif ( bbp_is_forum_hidden( $forum_id, $r['check_ancestors'] ) && user_can( $user_id, 'read_forum', $forum_id ) ) { 2160 2187 $retval = true; 2161 2188 } 2162 2189 2190 // Filter & return 2163 2191 return apply_filters( 'bbp_user_can_view_forum', $retval, $forum_id, $user_id ); 2164 2192 } … … 2196 2224 } 2197 2225 2198 // Allow access to be filtered2226 // Filter & return 2199 2227 return (bool) apply_filters( 'bbp_current_user_can_publish_topics', $retval ); 2200 2228 } … … 2226 2254 } 2227 2255 2228 // Allow access to be filtered2256 // Filter & return 2229 2257 return (bool) apply_filters( 'bbp_current_user_can_publish_forums', $retval ); 2230 2258 } … … 2262 2290 } 2263 2291 2264 // Allow access to be filtered2292 // Filter & return 2265 2293 return (bool) apply_filters( 'bbp_current_user_can_publish_replies', $retval ); 2266 2294 } … … 2303 2331 } 2304 2332 2333 // Filter & return 2305 2334 return apply_filters( 'bbp_get_forums_for_current_user', $forums, $r, $args ); 2306 2335 } … … 2336 2365 } 2337 2366 2338 // Allow access to be filtered2367 // Filter & return 2339 2368 return (bool) apply_filters( 'bbp_current_user_can_access_create_forum_form', (bool) $retval ); 2340 2369 } … … 2372 2401 } 2373 2402 2374 // Allow access to be filtered2403 // Filter & return 2375 2404 return (bool) apply_filters( 'bbp_current_user_can_access_create_topic_form', (bool) $retval ); 2376 2405 } … … 2408 2437 } 2409 2438 2410 // Allow access to be filtered2439 // Filter & return 2411 2440 return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval ); 2412 2441 } … … 2444 2473 } 2445 2474 2446 // Allow access to be filtered2475 // Filter & return 2447 2476 return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval ); 2448 2477 } … … 2508 2537 } 2509 2538 2539 // Filter & return 2510 2540 return apply_filters( 'bbp_get_moderator_list', $retval ); 2511 2541 }
Note: See TracChangeset
for help on using the changeset viewer.