Changeset 9511 for trunk/src/bp-groups/bp-groups-screens.php
- Timestamp:
- 02/18/2015 03:44:20 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-screens.php
r9471 r9511 22 22 bp_update_is_directory( true, 'groups' ); 23 23 24 /** 25 * Fires before the loading of the Groups directory index. 26 * 27 * @since BuddyPress (1.1.0) 28 */ 24 29 do_action( 'groups_directory_groups_setup' ); 25 30 31 /** 32 * Filters the template to load for the Groups directory index. 33 * 34 * @since BuddyPress (1.0.0) 35 * 36 * @param string $value Path to the groups directory index template to load. 37 */ 26 38 bp_core_load_template( apply_filters( 'groups_template_directory_groups', 'groups/index' ) ); 27 39 } … … 34 46 function groups_screen_my_groups() { 35 47 48 /** 49 * Fires before the loading of the My Groups page. 50 * 51 * @since BuddyPress (1.1.0) 52 */ 36 53 do_action( 'groups_screen_my_groups' ); 37 54 55 /** 56 * Filters the template to load for the My Groups page. 57 * 58 * @since BuddyPress (1.0.0) 59 * 60 * @param string $value Path to the My Groups page template to load. 61 */ 38 62 bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) ); 39 63 } … … 92 116 } 93 117 118 /** 119 * Fires before the loading of a users Groups > Invites template. 120 * 121 * @since BuddyPress (1.0.0) 122 * 123 * @param int $group_id ID of the group being displayed 124 */ 94 125 do_action( 'groups_screen_group_invites', $group_id ); 95 126 127 /** 128 * Filters the template to load for a users Groups > Invites page. 129 * 130 * @since BuddyPress (1.0.0) 131 * 132 * @param string $value Path to a users Groups > Invites page template. 133 */ 96 134 bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) ); 97 135 } … … 106 144 } 107 145 146 /** 147 * Fires before the loading of a single group's page. 148 * 149 * @since BuddyPress (1.0.0) 150 */ 108 151 do_action( 'groups_screen_group_home' ); 109 152 153 /** 154 * Filters the template to load for a single group's page. 155 * 156 * @since BuddyPress (1.0.0) 157 * 158 * @param string $value Path to a single group's template to load. 159 */ 110 160 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 111 161 } … … 190 240 } 191 241 242 /** 243 * Fires after a group forum topic has been stickied. 244 * 245 * @since BuddyPress (1.1.0) 246 * 247 * @param int $topic_id ID of the topic being stickied. 248 */ 192 249 do_action( 'groups_stick_forum_topic', $topic_id ); 193 250 bp_core_redirect( wp_get_referer() ); … … 205 262 } 206 263 264 /** 265 * Fires after a group forum topic has been un-stickied. 266 * 267 * @since BuddyPress (1.1.0) 268 * 269 * @param int $topic_id ID of the topic being un-stickied. 270 */ 207 271 do_action( 'groups_unstick_forum_topic', $topic_id ); 208 272 bp_core_redirect( wp_get_referer() ); … … 220 284 } 221 285 286 /** 287 * Fires after a group forum topic has been closed. 288 * 289 * @since BuddyPress (1.1.0) 290 * 291 * @param int $topic_id ID of the topic being closed. 292 */ 222 293 do_action( 'groups_close_forum_topic', $topic_id ); 223 294 bp_core_redirect( wp_get_referer() ); … … 235 306 } 236 307 308 /** 309 * Fires after a group forum topic has been opened. 310 * 311 * @since BuddyPress (1.1.0) 312 * 313 * @param int $topic_id ID of the topic being opened. 314 */ 237 315 do_action( 'groups_open_forum_topic', $topic_id ); 238 316 bp_core_redirect( wp_get_referer() ); … … 252 330 check_admin_referer( 'bp_forums_delete_topic' ); 253 331 332 /** 333 * Fires before a group forum topic is deleted. 334 * 335 * @since BuddyPress (1.5.0) 336 * 337 * @param int $topic_id ID of the topic being deleted. 338 */ 254 339 do_action( 'groups_before_delete_forum_topic', $topic_id ); 255 340 … … 260 345 } 261 346 347 /** 348 * Fires after a group forum topic has been deleted. 349 * 350 * @since BuddyPress (1.5.0) 351 * 352 * @param int $topic_id ID of the topic being deleted. 353 */ 262 354 do_action( 'groups_delete_forum_topic', $topic_id ); 263 355 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' ); … … 286 378 } 287 379 380 /** 381 * Fires after a group forum topic has been edited. 382 * 383 * @since BuddyPress (1.1.0) 384 * 385 * @param int $topic_id ID of the topic being edited. 386 */ 288 387 do_action( 'groups_edit_forum_topic', $topic_id ); 289 388 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' ); 290 389 } 291 390 391 /** 392 * Filters the template to load for a topic edit page. 393 * 394 * @since BuddyPress (1.1.0) 395 * 396 * @param string $value Path to a topic edit template. 397 */ 292 398 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); 293 399 … … 305 411 check_admin_referer( 'bp_forums_delete_post' ); 306 412 413 /** 414 * Fires before the deletion of a group forum post. 415 * 416 * @since BuddyPress (1.5.0) 417 * 418 * @param int $post_id ID of the forum post being deleted. 419 */ 307 420 do_action( 'groups_before_delete_forum_post', $post_id ); 308 421 … … 313 426 } 314 427 428 /** 429 * Fires after the deletion of a group forum post. 430 * 431 * @since BuddyPress (1.1.0) 432 * 433 * @param int $post_id ID of the forum post being deleted. 434 */ 315 435 do_action( 'groups_delete_forum_post', $post_id ); 316 436 bp_core_redirect( wp_get_referer() ); … … 343 463 } 344 464 465 /** 466 * Fires after the editing of a group forum post. 467 * 468 * @since BuddyPress (1.1.0) 469 * 470 * @param int $post_id ID of the forum post being edited. 471 */ 345 472 do_action( 'groups_edit_forum_post', $post_id ); 346 473 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); 347 474 } 348 475 476 /** This filter is documented in bp-groups/bp-groups-screens.php */ 349 477 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); 350 478 … … 355 483 } 356 484 485 /** 486 * Filters the template to load for a topic page. 487 * 488 * @since BuddyPress (1.1.0) 489 * 490 * @param string $value Path to a topic template. 491 */ 357 492 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) ); 358 493 } … … 404 539 } 405 540 541 /** 542 * Fires at the end of the group forum screen loading process. 543 * 544 * @since BuddyPress (1.0.0) 545 * 546 * @param int $topic_id ID of the topic being displayed. 547 * @param int $forum_id ID of the forum being displayed. 548 */ 406 549 do_action( 'groups_screen_group_forum', $topic_id, $forum_id ); 407 550 551 /** 552 * Filters the template to load for a group forum page. 553 * 554 * @since BuddyPress (1.0.0) 555 * 556 * @param string $value Path to a group forum template. 557 */ 408 558 bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) ); 409 559 } … … 423 573 groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) ); 424 574 575 /** 576 * Fires before the loading of a group's Members page. 577 * 578 * @since BuddyPress (1.0.0) 579 * 580 * @param int $id ID of the group whose members are being displayed. 581 */ 425 582 do_action( 'groups_screen_group_members', $bp->groups->current_group->id ); 583 584 /** 585 * Filters the template to load for a group's Members page. 586 * 587 * @since BuddyPress (1.0.0) 588 * 589 * @param string $value Path to a group's Members template. 590 */ 426 591 bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); 427 592 } … … 451 616 groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id ); 452 617 bp_core_add_message( __('Group invites sent.', 'buddypress') ); 618 619 /** 620 * Fires after the sending of a group invite inside the group's Send Invites page. 621 * 622 * @since BuddyPress (1.0.0) 623 * 624 * @param int $id ID of the group whose members are being displayed. 625 */ 453 626 do_action( 'groups_screen_group_invite', $bp->groups->current_group->id ); 454 627 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 455 628 456 629 } elseif ( !bp_action_variable( 0 ) ) { 457 // Show send invite page 630 631 /** 632 * Filters the template to load for a group's Send Invites page. 633 * 634 * @since BuddyPress (1.0.0) 635 * 636 * @param string $value Path to a group's Send Invites template. 637 */ 458 638 bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); 459 639 … … 543 723 } 544 724 725 /** 726 * Fires before the loading of a group's Request Memebership page. 727 * 728 * @since BuddyPress (1.0.0) 729 * 730 * @param int $id ID of the group currently being displayed. 731 */ 545 732 do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); 546 733 734 /** 735 * Filters the template to load for a group's Request Membership page. 736 * 737 * @since BuddyPress (1.0.0) 738 * 739 * @param string $value Path to a group's Request Membership template. 740 */ 547 741 bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); 548 742 } … … 558 752 buddypress()->is_single_item = true; 559 753 754 /** This filter is documented in bp-groups/bp-groups-screens.php */ 560 755 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 561 756 } … … 601 796 } 602 797 798 /** 799 * Fires before the redirect if a group details has been edited and saved. 800 * 801 * @since BuddyPress (1.0.0) 802 * 803 * @param int $id ID of the group that was edited. 804 */ 603 805 do_action( 'groups_group_details_edited', $bp->groups->current_group->id ); 604 806 … … 606 808 } 607 809 810 /** 811 * Fires before the loading of the group admin/edit-details page template. 812 * 813 * @since BuddyPress (1.0.0) 814 * 815 * @param int $id ID of the group that is being displayed. 816 */ 608 817 do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id ); 609 818 819 /** 820 * Filters the template to load for a group's admin/edit-details page. 821 * 822 * @since BuddyPress (1.0.0) 823 * 824 * @param string $value Path to a group's admin/edit-details template. 825 */ 610 826 bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) ); 611 827 } … … 631 847 632 848 // Checked against a whitelist for security 849 /** This filter is documented in bp-groups/bp-groups-admin.php */ 633 850 $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); 634 851 $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; 635 852 636 853 // Checked against a whitelist for security 854 /** This filter is documented in bp-groups/bp-groups-admin.php */ 637 855 $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); 638 856 $invite_status = isset( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; … … 648 866 } 649 867 868 /** 869 * Fires before the redirect if a group settings has been edited and saved. 870 * 871 * @since BuddyPress (1.0.0) 872 * 873 * @param int $id ID of the group that was edited. 874 */ 650 875 do_action( 'groups_group_settings_edited', $bp->groups->current_group->id ); 651 876 … … 653 878 } 654 879 880 /** 881 * Fires before the loading of the group admin/group-settings page template. 882 * 883 * @since BuddyPress (1.0.0) 884 * 885 * @param int $id ID of the group that is being displayed. 886 */ 655 887 do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id ); 656 888 889 /** 890 * Filters the template to load for a group's admin/group-settings page. 891 * 892 * @since BuddyPress (1.0.0) 893 * 894 * @param string $value Path to a group's admin/group-settings template. 895 */ 657 896 bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); 658 897 } … … 731 970 } 732 971 972 /** 973 * Fires before the loading of the group Change Avatar page template. 974 * 975 * @since BuddyPress (1.0.0) 976 * 977 * @param int $id ID of the group that is being displayed. 978 */ 733 979 do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id ); 734 980 981 /** 982 * Filters the template to load for a group's Change Avatar page. 983 * 984 * @since BuddyPress (1.0.0) 985 * 986 * @param string $value Path to a group's Change Avatar template. 987 */ 735 988 bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) ); 736 989 } … … 765 1018 bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) ); 766 1019 1020 /** 1021 * Fires before the redirect after a group member has been promoted. 1022 * 1023 * @since BuddyPress (1.0.0) 1024 * 1025 * @param int $user_id ID of the user being promoted. 1026 * @param int $id ID of the group user is promoted within. 1027 */ 767 1028 do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id ); 768 1029 … … 790 1051 bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) ); 791 1052 1053 /** 1054 * Fires before the redirect after a group member has been demoted. 1055 * 1056 * @since BuddyPress (1.0.0) 1057 * 1058 * @param int $user_id ID of the user being demoted. 1059 * @param int $id ID of the group user is demoted within. 1060 */ 792 1061 do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id ); 793 1062 … … 808 1077 bp_core_add_message( __( 'User banned successfully', 'buddypress' ) ); 809 1078 1079 /** 1080 * Fires before the redirect after a group member has been banned. 1081 * 1082 * @since BuddyPress (1.0.0) 1083 * 1084 * @param int $user_id ID of the user being banned. 1085 * @param int $id ID of the group user is banned from. 1086 */ 810 1087 do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id ); 811 1088 … … 826 1103 bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) ); 827 1104 1105 /** 1106 * Fires before the redirect after a group member has been unbanned. 1107 * 1108 * @since BuddyPress (1.0.0) 1109 * 1110 * @param int $user_id ID of the user being unbanned. 1111 * @param int $id ID of the group user is unbanned from. 1112 */ 828 1113 do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id ); 829 1114 … … 844 1129 bp_core_add_message( __( 'User removed successfully', 'buddypress' ) ); 845 1130 1131 /** 1132 * Fires before the redirect after a group member has been removed. 1133 * 1134 * @since BuddyPress (1.2.6) 1135 * 1136 * @param int $user_id ID of the user being removed. 1137 * @param int $id ID of the group the user is removed from. 1138 */ 846 1139 do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id ); 847 1140 … … 850 1143 } 851 1144 1145 /** 1146 * Fires before the loading of a group's manage members template. 1147 * 1148 * @since BuddyPress (1.0.0) 1149 * 1150 * @param int $id ID of the group whose manage members page is being displayed. 1151 */ 852 1152 do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id ); 853 1153 1154 /** 1155 * Filters the template to load for a group's manage members page. 1156 * 1157 * @since BuddyPress (1.0.0) 1158 * 1159 * @param string $value Path to a group's manage members template. 1160 */ 854 1161 bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) ); 855 1162 } … … 898 1205 } 899 1206 1207 /** 1208 * Fires before the redirect if a group membership request has been handled. 1209 * 1210 * @since BuddyPress (1.0.0) 1211 * 1212 * @param int $id ID of the group that was edited. 1213 * @param string $request_action Membership request action being performed. 1214 * @param int $membership_id The key of the action_variables array that you want. 1215 */ 900 1216 do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id ); 901 1217 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' ); 902 1218 } 903 1219 1220 /** 1221 * Fires before the loading of the group membership request page template. 1222 * 1223 * @since BuddyPress (1.0.0) 1224 * 1225 * @param int $id ID of the group that is being displayed. 1226 */ 904 1227 do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id ); 1228 1229 /** 1230 * Filters the template to load for a group's membership request page. 1231 * 1232 * @since BuddyPress (1.0.0) 1233 * 1234 * @param string $value Path to a group's membership request template. 1235 */ 905 1236 bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) ); 906 1237 } … … 927 1258 } 928 1259 1260 /** 1261 * Fires before the deletion of a group from the Delete Group page. 1262 * 1263 * @since BuddyPress (1.5.0) 1264 * 1265 * @param int $id ID of the group being deleted. 1266 */ 929 1267 do_action( 'groups_before_group_deleted', $bp->groups->current_group->id ); 930 1268 … … 935 1273 bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) ); 936 1274 1275 /** 1276 * Fires after the deletion of a group from the Delete Group page. 1277 * 1278 * @since BuddyPress (1.0.0) 1279 * 1280 * @param int $id ID of the group being deleted. 1281 */ 937 1282 do_action( 'groups_group_deleted', $bp->groups->current_group->id ); 938 1283 … … 943 1288 } 944 1289 1290 /** 1291 * Fires before the loading of the Delete Group page template. 1292 * 1293 * @since BuddyPress (1.0.0) 1294 * 1295 * @param int $id ID of the group that is being displayed. 1296 */ 945 1297 do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); 946 1298 1299 /** 1300 * Filters the template to load for the Delete Group page. 1301 * 1302 * @since BuddyPress (1.0.0) 1303 * 1304 * @param string $value Path to the Delete Group template. 1305 */ 947 1306 bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); 948 1307 } … … 1002 1361 </tr> 1003 1362 1004 <?php do_action( 'groups_screen_notification_settings' ); ?> 1363 <?php 1364 1365 /** 1366 * Fires at the end of the available group settings fields on Notification Settings page. 1367 * 1368 * @since BuddyPress (1.0.0) 1369 */ 1370 do_action( 'groups_screen_notification_settings' ); ?> 1005 1371 1006 1372 </tbody> … … 1047 1413 bp_update_is_directory( true, 'groups' ); 1048 1414 1415 /** 1416 * Fires at the start of the group theme compatibility setup. 1417 * 1418 * @since BuddyPress (1.1.0) 1419 */ 1049 1420 do_action( 'groups_directory_groups_setup' ); 1050 1421 … … 1082 1453 */ 1083 1454 public function directory_template_hierarchy( $templates ) { 1084 // Setup our templates based on priority 1455 1456 /** 1457 * Filters the Groups directory page template hierarchy based on priority. 1458 * 1459 * @since BuddyPress (1.8.0) 1460 * 1461 * @param array $value Array of default template files to use. 1462 */ 1085 1463 $new_templates = apply_filters( 'bp_template_hierarchy_groups_directory', array( 1086 1464 'groups/index-directory.php' … … 1136 1514 */ 1137 1515 public function create_template_hierarchy( $templates ) { 1138 // Setup our templates based on priority 1516 1517 /** 1518 * Filters the Groups create page template hierarchy based on priority. 1519 * 1520 * @since BuddyPress (1.8.0) 1521 * 1522 * @param array $value Array of default template files to use. 1523 */ 1139 1524 $new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array( 1140 1525 'groups/index-create.php' … … 1196 1581 $group = groups_get_current_group(); 1197 1582 1198 // Setup our templates based on priority 1583 /** 1584 * Filters the Groups single pages template hierarchy based on priority. 1585 * 1586 * @since BuddyPress (1.8.0) 1587 * 1588 * @param array $value Array of default template files to use. 1589 */ 1199 1590 $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array( 1200 1591 'groups/single/index-id-' . sanitize_file_name( bp_get_current_group_id() ) . '.php',
Note: See TracChangeset
for help on using the changeset viewer.