| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress BuddyPress Group Extension Class. | |
| 4 | + * bbPress BuddyPress Group Extension Class | |
| 5 | 5 | * |
| 6 | 6 | * This file is responsible for connecting bbPress to the BuddyPress Groups |
| 7 | 7 | * Component. It's a great example of how to perform both simple and advanced |
| 8 | 8 | * techniques to manipulate the default output provided by both. |
| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | defined( 'ABSPATH' ) || exit; |
| 16 | 16 | |
| 17 | 17 | if ( ! class_exists( 'BBP_Forums_Group_Extension' ) && class_exists( 'BP_Group_Extension' ) ) : |
| 18 | 18 | /** |
| 19 | - * Loads Group Extension for Forums Component. | |
| 19 | + * Loads Group Extension for Forums Component | |
| 20 | 20 | * |
| 21 | 21 | * @since 2.1.0 bbPress (r3552) |
| 22 | 22 | * |
| 23 | 23 | * @package bbPress |
| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | |
| 28 | 28 | /** Methods ***************************************************************/ |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * Setup bbPress group extension variables. | |
| 31 | + * Setup bbPress group extension variables | |
| 32 | 32 | * |
| 33 | 33 | * @since 2.1.0 bbPress (r3552) |
| 34 | 34 | */ |
| 35 | 35 | public function __construct() { |
| @@ -40,9 +40,9 @@ | ||
| 40 | 40 | $this->fully_loaded(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | - * Setup the group forums class variables. | |
| 44 | + * Setup the group forums class variables | |
| 45 | 45 | * |
| 46 | 46 | * @since 2.3.0 bbPress (r4553) |
| 47 | 47 | */ |
| 48 | 48 | private function setup_variables() { |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | $this->display_hook = 'bp_template_content'; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * Setup the group forums class actions. | |
| 77 | + * Setup the group forums class actions | |
| 78 | 78 | * |
| 79 | 79 | * @since 2.3.0 bbPress (r4553) |
| 80 | 80 | */ |
| 81 | 81 | private function setup_actions() { |
| @@ -106,9 +106,9 @@ | ||
| 106 | 106 | add_action( 'bp_before_group_settings_admin', array( $this, 'group_settings_hidden_field' ) ); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Setup the group forums class filters. | |
| 110 | + * Setup the group forums class filters | |
| 111 | 111 | * |
| 112 | 112 | * @since 2.3.0 bbPress (r4553) |
| 113 | 113 | */ |
| 114 | 114 | private function setup_filters() { |
| @@ -167,9 +167,9 @@ | ||
| 167 | 167 | |
| 168 | 168 | /** |
| 169 | 169 | * Check whether a user can view a private or hidden group forum. |
| 170 | 170 | * |
| 171 | - * @since 2.7.0 bbPress (r7495) | |
| 171 | + * @since 2.6.17 bbPress (r7496) | |
| 172 | 172 | * |
| 173 | 173 | * @param int $user_id User ID. |
| 174 | 174 | * @param int $forum_id Forum ID. |
| 175 | 175 | * @return bool|null Whether the user can view the group forum, or null when |
| @@ -202,9 +202,9 @@ | ||
| 202 | 202 | |
| 203 | 203 | /** |
| 204 | 204 | * Map read access for private and hidden group forums in every request. |
| 205 | 205 | * |
| 206 | - * @since 2.7.0 bbPress (r7495) | |
| 206 | + * @since 2.6.17 bbPress (r7496) | |
| 207 | 207 | * |
| 208 | 208 | * @param array $caps Capabilities for the meta capability. |
| 209 | 209 | * @param string $cap Capability name. |
| 210 | 210 | * @param int $user_id User ID. |
| @@ -235,10 +235,10 @@ | ||
| 235 | 235 | |
| 236 | 236 | /** |
| 237 | 237 | * Exclude private and hidden group forums a user cannot view. |
| 238 | 238 | * |
| 239 | - * @since 2.7.0 bbPress (r7495) | |
| 240 | - * @since 2.6.19 bbPress (r7677) Exclude unreadable descendants. | |
| 239 | + * @since 2.6.17 bbPress (r7496) | |
| 240 | + * @since 2.6.19 bbPress (r7678) Exclude unreadable descendants. | |
| 241 | 241 | * |
| 242 | 242 | * @param array $forum_ids Forum IDs already excluded. |
| 243 | 243 | * @return array Forum IDs the user cannot view. |
| 244 | 244 | */ |
| @@ -308,9 +308,9 @@ | ||
| 308 | 308 | * |
| 309 | 309 | * Unlike the request-specific capability mapping, this check accepts an |
| 310 | 310 | * explicit user ID so it can validate subscription recipients. |
| 311 | 311 | * |
| 312 | - * @since 2.6.17 bbPress (r7493) | |
| 312 | + * @since 2.6.17 bbPress (r7494) | |
| 313 | 313 | * |
| 314 | 314 | * @param bool $retval Whether the user can view the forum. |
| 315 | 315 | * @param int $user_id User ID. |
| 316 | 316 | * @param int $forum_id Forum ID. |
| @@ -372,9 +372,9 @@ | ||
| 372 | 372 | return $retval; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /** |
| 376 | - * The primary display function for group forums. | |
| 376 | + * The primary display function for group forums | |
| 377 | 377 | * |
| 378 | 378 | * @since 2.1.0 bbPress (r3552) |
| 379 | 379 | * |
| 380 | 380 | * @param int $group_id ID of the current group. Available only on BP 2.2+. |
| @@ -397,13 +397,13 @@ | ||
| 397 | 397 | $this->display_forums( 0 ); |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /** |
| 401 | - * Maybe unset the group forum nav item if group does not have a forum. | |
| 401 | + * Maybe unset the group forum nav item if group does not have a forum | |
| 402 | 402 | * |
| 403 | 403 | * @since 2.3.0 bbPress (r4553) |
| 404 | 404 | * |
| 405 | - * @return If not viewing a single group. | |
| 405 | + * @return If not viewing a single group | |
| 406 | 406 | */ |
| 407 | 407 | public function maybe_unset_forum_menu() { |
| 408 | 408 | |
| 409 | 409 | // Bail if not viewing a single group |
| @@ -470,10 +470,10 @@ | ||
| 470 | 470 | |
| 471 | 471 | switch ( $cap ) { |
| 472 | 472 | |
| 473 | 473 | // If user is a group mmember, allow them to create content. |
| 474 | - case 'publish_replies' : | |
| 475 | - case 'publish_topics' : | |
| 474 | + case 'publish_replies' : | |
| 475 | + case 'publish_topics' : | |
| 476 | 476 | if ( bbp_group_is_banned() ) { |
| 477 | 477 | $caps = array( 'do_not_allow' ); |
| 478 | 478 | } elseif ( bbp_group_is_member() || bbp_group_is_mod() || bbp_group_is_admin() ) { |
| 479 | 479 | $caps = array( 'participate' ); |
| @@ -508,18 +508,9 @@ | ||
| 508 | 508 | } |
| 509 | 509 | break; |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - /** | |
| 513 | - * Filters the Group Forum Topic meta capabilities. | |
| 514 | - * | |
| 515 | - * @since 2.2.0 bbPress (r4435) | |
| 516 | - * | |
| 517 | - * @param array $caps Capabilities for the meta capability. | |
| 518 | - * @param string $cap Capability name. | |
| 519 | - * @param int $user_id User ID. | |
| 520 | - * @param array $args Arguments. | |
| 521 | - */ | |
| 512 | + // Filter & return | |
| 522 | 513 | return (array) apply_filters( 'bbp_map_group_forum_topic_meta_caps', $caps, $cap, $user_id, $args ); |
| 523 | 514 | } |
| 524 | 515 | |
| 525 | 516 | /** |
| @@ -541,11 +532,11 @@ | ||
| 541 | 532 | * - A forum the current user can moderate outside of this group |
| 542 | 533 | * |
| 543 | 534 | * If all checks fail, an error gets added to prevent the topic from saving. |
| 544 | 535 | * |
| 545 | - * @since 2.6.14 bbPress (r7060) | |
| 536 | + * @since 2.6.4 bbPress (r7059) | |
| 546 | 537 | * |
| 547 | - * @param int $topic_id Topic id. | |
| 538 | + * @param int $topic_id | |
| 548 | 539 | */ |
| 549 | 540 | public function validate_topic_forum_id( $topic_id = 0 ) { |
| 550 | 541 | |
| 551 | 542 | // Bail if no topic |
| @@ -602,11 +593,11 @@ | ||
| 602 | 593 | * be saved to the current topic. |
| 603 | 594 | * |
| 604 | 595 | * If all checks fail, an error gets added to prevent the reply from saving. |
| 605 | 596 | * |
| 606 | - * @since 2.6.14 bbPress (r7060) | |
| 597 | + * @since 2.6.4 bbPress (r7059) | |
| 607 | 598 | * |
| 608 | - * @param int $reply_id Reply id. | |
| 599 | + * @param int $reply_id | |
| 609 | 600 | */ |
| 610 | 601 | public function validate_reply_to_id( $reply_id = 0 ) { |
| 611 | 602 | |
| 612 | 603 | // Bail if no reply |
| @@ -660,9 +651,9 @@ | ||
| 660 | 651 | |
| 661 | 652 | /** Edit ******************************************************************/ |
| 662 | 653 | |
| 663 | 654 | /** |
| 664 | - * Show forums and new forum form when editing a group. | |
| 655 | + * Show forums and new forum form when editing a group | |
| 665 | 656 | * |
| 666 | 657 | * @since 2.1.0 bbPress (r3552) |
| 667 | 658 | * |
| 668 | 659 | * @param object $group (the group to edit if in Group Admin UI) |
| @@ -726,13 +717,13 @@ | ||
| 726 | 717 | } |
| 727 | 718 | } |
| 728 | 719 | |
| 729 | 720 | /** |
| 730 | - * Save the Group Forum data on edit. | |
| 721 | + * Save the Group Forum data on edit | |
| 731 | 722 | * |
| 732 | 723 | * @since 2.1.0 bbPress (r3552) |
| 733 | 724 | * |
| 734 | - * @param int $group_id (to handle Group Admin UI hook bp_group_admin_edit_after). | |
| 725 | + * @param int $group_id (to handle Group Admin UI hook bp_group_admin_edit_after ) | |
| 735 | 726 | */ |
| 736 | 727 | public function edit_screen_save( $group_id = 0 ) { |
| 737 | 728 | |
| 738 | 729 | // Bail if not a POST action |
| @@ -843,9 +834,9 @@ | ||
| 843 | 834 | } |
| 844 | 835 | } |
| 845 | 836 | |
| 846 | 837 | /** |
| 847 | - * Adds a meta-box to BuddyPress Group Admin UI. | |
| 838 | + * Adds a meta-box to BuddyPress Group Admin UI | |
| 848 | 839 | * |
| 849 | 840 | * @since 2.3.0 bbPress (r4815) |
| 850 | 841 | */ |
| 851 | 842 | public function group_admin_ui_edit_screen() { |
| @@ -850,9 +841,9 @@ | ||
| 850 | 841 | */ |
| 851 | 842 | public function group_admin_ui_edit_screen() { |
| 852 | 843 | add_meta_box( |
| 853 | 844 | 'bbpress_group_admin_ui_meta_box', |
| 854 | - esc_html_x( 'Forum', 'group admin edit screen', 'bbpress' ), | |
| 845 | + _x( 'Discussion Forum', 'group admin edit screen', 'bbpress' ), | |
| 855 | 846 | array( $this, 'group_admin_ui_display_metabox' ), |
| 856 | 847 | get_current_screen()->id, |
| 857 | 848 | 'side', |
| 858 | 849 | 'core' |
| @@ -859,13 +850,13 @@ | ||
| 859 | 850 | ); |
| 860 | 851 | } |
| 861 | 852 | |
| 862 | 853 | /** |
| 863 | - * Displays the bbPress meta-box in BuddyPress Group Admin UI. | |
| 854 | + * Displays the bbPress meta-box in BuddyPress Group Admin UI | |
| 864 | 855 | * |
| 865 | 856 | * @since 2.3.0 bbPress (r4815) |
| 866 | 857 | * |
| 867 | - * @param object $item (group object). | |
| 858 | + * @param object $item (group object) | |
| 868 | 859 | */ |
| 869 | 860 | public function group_admin_ui_display_metabox( $item ) { |
| 870 | 861 | $this->edit_screen( $item ); |
| 871 | 862 | } |
| @@ -872,9 +863,9 @@ | ||
| 872 | 863 | |
| 873 | 864 | /** Create ****************************************************************/ |
| 874 | 865 | |
| 875 | 866 | /** |
| 876 | - * Show forums and new forum form when creating a group. | |
| 867 | + * Show forums and new forum form when creating a group | |
| 877 | 868 | * |
| 878 | 869 | * @since 2.1.0 bbPress (r3552) |
| 879 | 870 | */ |
| 880 | 871 | public function create_screen( $group_id = 0 ) { |
| @@ -902,9 +893,9 @@ | ||
| 902 | 893 | <?php |
| 903 | 894 | } |
| 904 | 895 | |
| 905 | 896 | /** |
| 906 | - * Save the Group Forum data on create. | |
| 897 | + * Save the Group Forum data on create | |
| 907 | 898 | * |
| 908 | 899 | * @since 2.1.0 bbPress (r3552) |
| 909 | 900 | */ |
| 910 | 901 | public function create_screen_save( $group_id = 0 ) { |
| @@ -991,9 +982,9 @@ | ||
| 991 | 982 | } |
| 992 | 983 | } |
| 993 | 984 | |
| 994 | 985 | /** |
| 995 | - * Used to start an output buffer. | |
| 986 | + * Used to start an output buffer | |
| 996 | 987 | * |
| 997 | 988 | * @since 2.1.0 bbPress (r3746) |
| 998 | 989 | */ |
| 999 | 990 | public function ob_start() { |
| @@ -1000,9 +991,9 @@ | ||
| 1000 | 991 | ob_start(); |
| 1001 | 992 | } |
| 1002 | 993 | |
| 1003 | 994 | /** |
| 1004 | - * Used to end an output buffer. | |
| 995 | + * Used to end an output buffer | |
| 1005 | 996 | * |
| 1006 | 997 | * @since 2.1.0 bbPress (r3746) |
| 1007 | 998 | */ |
| 1008 | 999 | public function ob_end_clean() { |
| @@ -1009,15 +1000,15 @@ | ||
| 1009 | 1000 | ob_end_clean(); |
| 1010 | 1001 | } |
| 1011 | 1002 | |
| 1012 | 1003 | /** |
| 1013 | - * Creating a group forum or category (including root for group). | |
| 1004 | + * Creating a group forum or category (including root for group) | |
| 1014 | 1005 | * |
| 1015 | 1006 | * @since 2.1.0 bbPress (r3654) |
| 1016 | 1007 | * |
| 1017 | 1008 | * @param array $forum_args |
| 1018 | 1009 | * |
| 1019 | - * @return void if no forum_id is available. | |
| 1010 | + * @return void if no forum_id is available | |
| 1020 | 1011 | */ |
| 1021 | 1012 | public function new_forum( $forum_args = array() ) { |
| 1022 | 1013 | |
| 1023 | 1014 | // Bail if no forum_id was passed |
| @@ -1026,11 +1017,9 @@ | ||
| 1026 | 1017 | } |
| 1027 | 1018 | |
| 1028 | 1019 | // Validate forum_id |
| 1029 | 1020 | $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); |
| 1030 | - $group_id = ! empty( $forum_args['group_id'] ) | |
| 1031 | - ? $forum_args['group_id'] | |
| 1032 | - : bp_get_current_group_id(); | |
| 1021 | + $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); | |
| 1033 | 1022 | |
| 1034 | 1023 | bbp_add_forum_id_to_group( $group_id, $forum_id ); |
| 1035 | 1024 | bbp_add_group_id_to_forum( $forum_id, $group_id ); |
| 1036 | 1025 | } |
| @@ -1035,15 +1024,15 @@ | ||
| 1035 | 1024 | bbp_add_group_id_to_forum( $forum_id, $group_id ); |
| 1036 | 1025 | } |
| 1037 | 1026 | |
| 1038 | 1027 | /** |
| 1039 | - * Removing a group forum or category (including root for group). | |
| 1028 | + * Removing a group forum or category (including root for group) | |
| 1040 | 1029 | * |
| 1041 | 1030 | * @since 2.1.0 bbPress (r3654) |
| 1042 | 1031 | * |
| 1043 | 1032 | * @param array $forum_args |
| 1044 | 1033 | * |
| 1045 | - * @return void if no forum_id is available. | |
| 1034 | + * @return void if no forum_id is available | |
| 1046 | 1035 | */ |
| 1047 | 1036 | public function remove_forum( $forum_args = array() ) { |
| 1048 | 1037 | |
| 1049 | 1038 | // Bail if no forum_id was passed |
| @@ -1052,11 +1041,9 @@ | ||
| 1052 | 1041 | } |
| 1053 | 1042 | |
| 1054 | 1043 | // Validate forum_id |
| 1055 | 1044 | $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); |
| 1056 | - $group_id = ! empty( $forum_args['group_id'] ) | |
| 1057 | - ? $forum_args['group_id'] | |
| 1058 | - : bp_get_current_group_id(); | |
| 1045 | + $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); | |
| 1059 | 1046 | |
| 1060 | 1047 | bbp_remove_forum_id_from_group( $group_id, $forum_id ); |
| 1061 | 1048 | bbp_remove_group_id_from_forum( $forum_id, $group_id ); |
| 1062 | 1049 | |
| @@ -1067,13 +1054,13 @@ | ||
| 1067 | 1054 | } |
| 1068 | 1055 | } |
| 1069 | 1056 | |
| 1070 | 1057 | /** |
| 1071 | - * Listening to BuddyPress Group deletion to remove the forum. | |
| 1058 | + * Listening to BuddyPress Group deletion to remove the forum | |
| 1072 | 1059 | * |
| 1073 | 1060 | * @since 2.3.0 bbPress (r4815) |
| 1074 | 1061 | * |
| 1075 | - * @param int $group_id The group ID. | |
| 1062 | + * @param int $group_id The group ID | |
| 1076 | 1063 | */ |
| 1077 | 1064 | public function disconnect_forum_from_group( $group_id = 0 ) { |
| 1078 | 1065 | |
| 1079 | 1066 | // Bail if no group ID available |
| @@ -1101,11 +1088,11 @@ | ||
| 1101 | 1088 | |
| 1102 | 1089 | /** |
| 1103 | 1090 | * Update forum attributes to match those of the associated group. |
| 1104 | 1091 | * |
| 1105 | - * Fired whenever a group is saved. | |
| 1092 | + * Fired whenever a group is saved | |
| 1106 | 1093 | * |
| 1107 | - * @since 2.6.7 bbPress (r7210) | |
| 1094 | + * @since 2.6.7 bbPress (r7209) | |
| 1108 | 1095 | * |
| 1109 | 1096 | * @param BP_Groups_Group $group Group object. |
| 1110 | 1097 | */ |
| 1111 | 1098 | public static function update_group_forum( BP_Groups_Group $group ) { |
| @@ -1181,15 +1168,15 @@ | ||
| 1181 | 1168 | } |
| 1182 | 1169 | } |
| 1183 | 1170 | |
| 1184 | 1171 | /** |
| 1185 | - * Toggle the enable_forum group setting on or off. | |
| 1172 | + * Toggle the enable_forum group setting on or off | |
| 1186 | 1173 | * |
| 1187 | 1174 | * @since 2.3.0 bbPress (r4613) |
| 1188 | 1175 | * |
| 1189 | - * @param int $group_id The group to toggle. | |
| 1190 | - * @param bool $enabled True for on, false for off. | |
| 1191 | - * @return False if group is not found, otherwise return the group. | |
| 1176 | + * @param int $group_id The group to toggle | |
| 1177 | + * @param bool $enabled True for on, false for off | |
| 1178 | + * @return False if group is not found, otherwise return the group | |
| 1192 | 1179 | */ |
| 1193 | 1180 | public function toggle_group_forum( $group_id = 0, $enabled = false ) { |
| 1194 | 1181 | |
| 1195 | 1182 | // Get the group |
| @@ -1220,9 +1207,9 @@ | ||
| 1220 | 1207 | |
| 1221 | 1208 | /** Display Methods *******************************************************/ |
| 1222 | 1209 | |
| 1223 | 1210 | /** |
| 1224 | - * Output the forums for a group in the edit screens. | |
| 1211 | + * Output the forums for a group in the edit screens | |
| 1225 | 1212 | * |
| 1226 | 1213 | * As of right now, bbPress only supports 1-to-1 group forum relationships. |
| 1227 | 1214 | * In the future, many-to-many should be allowed. |
| 1228 | 1215 | * |
| @@ -1448,9 +1435,8 @@ | ||
| 1448 | 1435 | break; |
| 1449 | 1436 | endswitch; |
| 1450 | 1437 | |
| 1451 | 1438 | // Reset the query |
| 1452 | - // phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query | |
| 1453 | 1439 | wp_reset_query(); ?> |
| 1454 | 1440 | |
| 1455 | 1441 | </div><!-- #bbpress-forums --> |
| 1456 | 1442 | |
| @@ -1462,14 +1448,14 @@ | ||
| 1462 | 1448 | |
| 1463 | 1449 | /** Super sticky filters ***************************************************/ |
| 1464 | 1450 | |
| 1465 | 1451 | /** |
| 1466 | - * Strip super stickies from the topic query. | |
| 1452 | + * Strip super stickies from the topic query | |
| 1467 | 1453 | * |
| 1468 | 1454 | * @since 2.3.0 bbPress (r4809) |
| 1469 | 1455 | * |
| 1470 | 1456 | * @access private |
| 1471 | - * @param array $super the super sticky post ID's. | |
| 1457 | + * @param array $super the super sticky post ID's | |
| 1472 | 1458 | * @return array (empty) |
| 1473 | 1459 | */ |
| 1474 | 1460 | public function no_super_stickies( $super = array() ) { |
| 1475 | 1461 | $super = array(); |
| @@ -1476,15 +1462,15 @@ | ||
| 1476 | 1462 | return $super; |
| 1477 | 1463 | } |
| 1478 | 1464 | |
| 1479 | 1465 | /** |
| 1480 | - * Unset the type super sticky from topic type. | |
| 1466 | + * Unset the type super sticky from topic type | |
| 1481 | 1467 | * |
| 1482 | 1468 | * @since 2.3.0 bbPress (r4809) |
| 1483 | 1469 | * |
| 1484 | 1470 | * @access private |
| 1485 | 1471 | * @param array $args |
| 1486 | - * @return array $args without the to-front link. | |
| 1472 | + * @return array $args without the to-front link | |
| 1487 | 1473 | */ |
| 1488 | 1474 | public function unset_super_sticky( $args = array() ) { |
| 1489 | 1475 | if ( isset( $args['super'] ) ) { |
| 1490 | 1476 | unset( $args['super'] ); |
| @@ -1492,9 +1478,9 @@ | ||
| 1492 | 1478 | return $args; |
| 1493 | 1479 | } |
| 1494 | 1480 | |
| 1495 | 1481 | /** |
| 1496 | - * Ugly preg_replace to hide the to front admin link. | |
| 1482 | + * Ugly preg_replace to hide the to front admin link | |
| 1497 | 1483 | * |
| 1498 | 1484 | * @since 2.3.0 bbPress (r4809) |
| 1499 | 1485 | * |
| 1500 | 1486 | * @access private |
| @@ -1499,9 +1485,9 @@ | ||
| 1499 | 1485 | * |
| 1500 | 1486 | * @access private |
| 1501 | 1487 | * @param string $retval |
| 1502 | 1488 | * @param array $args |
| 1503 | - * @return string $retval without the to-front link. | |
| 1489 | + * @return string $retval without the to-front link | |
| 1504 | 1490 | */ |
| 1505 | 1491 | public function hide_super_sticky_admin_link( $retval = '', $args = array() ) { |
| 1506 | 1492 | if ( strpos( $retval, '(' ) ) { |
| 1507 | 1493 | $retval = preg_replace( '/(\(.+?)+(\))/i', '', $retval ); |
| @@ -1512,9 +1498,9 @@ | ||
| 1512 | 1498 | |
| 1513 | 1499 | /** Redirect Helpers ******************************************************/ |
| 1514 | 1500 | |
| 1515 | 1501 | /** |
| 1516 | - * Redirect to the group forum screen. | |
| 1502 | + * Redirect to the group forum screen | |
| 1517 | 1503 | * |
| 1518 | 1504 | * @since 2.1.0 bbPress (r3789) |
| 1519 | 1505 | * |
| 1520 | 1506 | * @param str $redirect_url |
| @@ -1530,9 +1516,9 @@ | ||
| 1530 | 1516 | return $redirect_url; |
| 1531 | 1517 | } |
| 1532 | 1518 | |
| 1533 | 1519 | /** |
| 1534 | - * Redirect to the group forum screen. | |
| 1520 | + * Redirect to the group forum screen | |
| 1535 | 1521 | * |
| 1536 | 1522 | * @since 2.1.0 bbPress (r3799) |
| 1537 | 1523 | */ |
| 1538 | 1524 | public function new_reply_redirect_to( $redirect_url = '', $redirect_to = '', $reply_id = 0 ) { |
| @@ -1563,9 +1549,9 @@ | ||
| 1563 | 1549 | return $redirect_url; |
| 1564 | 1550 | } |
| 1565 | 1551 | |
| 1566 | 1552 | /** |
| 1567 | - * Redirect to the group admin forum edit screen. | |
| 1553 | + * Redirect to the group admin forum edit screen | |
| 1568 | 1554 | * |
| 1569 | 1555 | * @since 2.1.0 bbPress (r3654) |
| 1570 | 1556 | */ |
| 1571 | 1557 | public function edit_redirect_to( $redirect_url = '' ) { |
| @@ -1700,9 +1686,9 @@ | ||
| 1700 | 1686 | |
| 1701 | 1687 | /** |
| 1702 | 1688 | * Get the URL for a group. |
| 1703 | 1689 | * |
| 1704 | - * @since 2.6.14 bbPress (r7316) | |
| 1690 | + * @since 2.6.14 bbPress (r7317) | |
| 1705 | 1691 | * |
| 1706 | 1692 | * @param int $group_id |
| 1707 | 1693 | * @return string |
| 1708 | 1694 | */ |
| @@ -1726,9 +1712,9 @@ | ||
| 1726 | 1712 | |
| 1727 | 1713 | /** |
| 1728 | 1714 | * Get the management URL for a group. |
| 1729 | 1715 | * |
| 1730 | - * @since 2.6.14 bbPress (r7316) | |
| 1716 | + * @since 2.6.14 bbPress (r7317) | |
| 1731 | 1717 | * |
| 1732 | 1718 | * @param int $group_id |
| 1733 | 1719 | * @return string |
| 1734 | 1720 | */ |
| @@ -1750,14 +1736,14 @@ | ||
| 1750 | 1736 | return $retval; |
| 1751 | 1737 | } |
| 1752 | 1738 | |
| 1753 | 1739 | /** |
| 1754 | - * Maybe map a bbPress forum/topic/reply permalink to the corresponding group. | |
| 1740 | + * Maybe map a bbPress forum/topic/reply permalink to the corresponding group | |
| 1755 | 1741 | * |
| 1756 | 1742 | * @since 2.2.0 bbPress (r4395) |
| 1757 | 1743 | * |
| 1758 | 1744 | * @param int $post_id |
| 1759 | - * @return Bail early if not a group forum post. | |
| 1745 | + * @return Bail early if not a group forum post | |
| 1760 | 1746 | * @return string |
| 1761 | 1747 | */ |
| 1762 | 1748 | private function maybe_map_permalink_to_group( $post_id = 0, $url = false ) { |
| 1763 | 1749 | |
| @@ -1806,9 +1792,9 @@ | ||
| 1806 | 1792 | return trailingslashit( trailingslashit( trailingslashit( $group_permalink ) . $this->slug ) . $url_end ); |
| 1807 | 1793 | } |
| 1808 | 1794 | |
| 1809 | 1795 | /** |
| 1810 | - * Map a forum permalink to its corresponding group. | |
| 1796 | + * Map a forum permalink to its corresponding group | |
| 1811 | 1797 | * |
| 1812 | 1798 | * @since 2.1.0 bbPress (r3746) |
| 1813 | 1799 | * |
| 1814 | 1800 | * @param string $url |
| @@ -1819,9 +1805,9 @@ | ||
| 1819 | 1805 | return $this->maybe_map_permalink_to_group( $forum_id, $url ); |
| 1820 | 1806 | } |
| 1821 | 1807 | |
| 1822 | 1808 | /** |
| 1823 | - * Map a topic permalink to its group forum. | |
| 1809 | + * Map a topic permalink to its group forum | |
| 1824 | 1810 | * |
| 1825 | 1811 | * @since 2.1.0 bbPress (r3746) |
| 1826 | 1812 | * |
| 1827 | 1813 | * @param string $url |
| @@ -1832,9 +1818,9 @@ | ||
| 1832 | 1818 | return $this->maybe_map_permalink_to_group( $topic_id, $url ); |
| 1833 | 1819 | } |
| 1834 | 1820 | |
| 1835 | 1821 | /** |
| 1836 | - * Map a reply permalink to its group forum. | |
| 1822 | + * Map a reply permalink to its group forum | |
| 1837 | 1823 | * |
| 1838 | 1824 | * @since 2.1.0 bbPress (r3746) |
| 1839 | 1825 | * |
| 1840 | 1826 | * @param string $url |
| @@ -1845,9 +1831,9 @@ | ||
| 1845 | 1831 | return $this->maybe_map_permalink_to_group( bbp_get_reply_topic_id( $reply_id ), $url ); |
| 1846 | 1832 | } |
| 1847 | 1833 | |
| 1848 | 1834 | /** |
| 1849 | - * Map a reply edit link to its group forum. | |
| 1835 | + * Map a reply edit link to its group forum | |
| 1850 | 1836 | * |
| 1851 | 1837 | * @since 2.2.0 bbPress (r4395) |
| 1852 | 1838 | * |
| 1853 | 1839 | * @param string $url |
| @@ -1864,9 +1850,9 @@ | ||
| 1864 | 1850 | return trailingslashit( $new ) . bbpress()->edit_id . '/'; |
| 1865 | 1851 | } |
| 1866 | 1852 | |
| 1867 | 1853 | /** |
| 1868 | - * Map a post link to its group forum. | |
| 1854 | + * Map a post link to its group forum | |
| 1869 | 1855 | * |
| 1870 | 1856 | * @since 2.2.0 bbPress (r4395) |
| 1871 | 1857 | * |
| 1872 | 1858 | * @param string $url |
| @@ -1878,9 +1864,9 @@ | ||
| 1878 | 1864 | return $this->maybe_map_permalink_to_group( $post->ID, $url ); |
| 1879 | 1865 | } |
| 1880 | 1866 | |
| 1881 | 1867 | /** |
| 1882 | - * Map a page link to its group forum. | |
| 1868 | + * Map a page link to its group forum | |
| 1883 | 1869 | * |
| 1884 | 1870 | * @since 2.2.0 bbPress (r4395) |
| 1885 | 1871 | * |
| 1886 | 1872 | * @param string $url |
| @@ -1892,9 +1878,9 @@ | ||
| 1892 | 1878 | return $this->maybe_map_permalink_to_group( $post_id, $url ); |
| 1893 | 1879 | } |
| 1894 | 1880 | |
| 1895 | 1881 | /** |
| 1896 | - * Map a custom post type link to its group forum. | |
| 1882 | + * Map a custom post type link to its group forum | |
| 1897 | 1883 | * |
| 1898 | 1884 | * @since 2.2.0 bbPress (r4395) |
| 1899 | 1885 | * |
| 1900 | 1886 | * @param string $url |
| @@ -1907,9 +1893,9 @@ | ||
| 1907 | 1893 | return $this->maybe_map_permalink_to_group( $post->ID, $url ); |
| 1908 | 1894 | } |
| 1909 | 1895 | |
| 1910 | 1896 | /** |
| 1911 | - * Fix pagination of topics on forum view. | |
| 1897 | + * Fix pagination of topics on forum view | |
| 1912 | 1898 | * |
| 1913 | 1899 | * @since 2.2.0 bbPress (r4395) |
| 1914 | 1900 | * |
| 1915 | 1901 | * @param array $args |
| @@ -1927,9 +1913,9 @@ | ||
| 1927 | 1913 | return $args; |
| 1928 | 1914 | } |
| 1929 | 1915 | |
| 1930 | 1916 | /** |
| 1931 | - * Fix pagination of replies on topic view. | |
| 1917 | + * Fix pagination of replies on topic view | |
| 1932 | 1918 | * |
| 1933 | 1919 | * @since 2.2.0 bbPress (r4395) |
| 1934 | 1920 | * |
| 1935 | 1921 | * @param array $args |
| @@ -1951,13 +1937,13 @@ | ||
| 1951 | 1937 | * |
| 1952 | 1938 | * Required for compatibility with BuddyPress > 12.0, where the /groups/ |
| 1953 | 1939 | * rewrite rule will be caught before bbPress's /page/ rule. |
| 1954 | 1940 | * |
| 1955 | - * @since 2.6.14 bbPress (r7316) | |
| 1941 | + * @since 2.6.14 bbPress (r7317) | |
| 1956 | 1942 | * |
| 1957 | - * @param object $query Verified query object. | |
| 1958 | - * @param string $type Type of variable to compare to. | |
| 1959 | - * @return mixed Verified object if valid, Default or null if invalid. | |
| 1943 | + * @param object object Verified object | |
| 1944 | + * @param string $type Type of variable to check with `is_a()` | |
| 1945 | + * @return mixed $object Verified object if valid, Default or null if invalid | |
| 1960 | 1946 | */ |
| 1961 | 1947 | public function rewrite_pagination( $query, $type = '' ) { |
| 1962 | 1948 | |
| 1963 | 1949 | // Bail if wrong global |