- Timestamp:
- 09/27/2024 09:11:27 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-component.php
r13689 r14026 338 338 339 339 // Check the parsed query is consistent with the Group’s registered screens. 340 add_action( 'bp_parse_query', array( $this, 'check_parsed_query' ), 999, 0 );340 add_action( 'bp_parse_query', array( $this, 'check_parsed_query' ), 999, 0 ); 341 341 } 342 342 … … 448 448 * @param array $value Array of valid group statuses. 449 449 */ 450 $this->valid_status = apply_filters( 'groups_valid_status', array( 451 'public', 452 'private', 453 'hidden' 454 ) ); 450 $this->valid_status = apply_filters( 451 'groups_valid_status', 452 array( 453 'public', 454 'private', 455 'hidden', 456 ) 457 ); 455 458 456 459 // Auto join group when non group member performs group activity. … … 483 486 'table_name' => $bp->table_prefix . 'bp_groups', 484 487 'table_name_members' => $bp->table_prefix . 'bp_groups_members', 485 'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta' 488 'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta', 486 489 ); 487 490 … … 493 496 // Fetch the default directory title. 494 497 $default_directory_titles = bp_core_get_directory_page_default_titles(); 495 $default_directory_title = $default_directory_titles[ $this->id];498 $default_directory_title = $default_directory_titles[ $this->id ]; 496 499 497 500 // All globals for groups component. … … 610 613 * action variables. 611 614 */ 612 if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) {615 if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) { 613 616 unset( $bp->canonical_stack['action'] ); 614 617 } … … 635 638 'screen_function' => 'groups_screen_my_groups', 636 639 'default_subnav_slug' => 'my-groups', 637 'item_css_id' => $this->id 640 'item_css_id' => $this->id, 638 641 ); 639 642 … … 645 648 'screen_function' => 'groups_screen_my_groups', 646 649 'position' => 10, 647 'item_css_id' => 'groups-my-groups' 650 'item_css_id' => 'groups-my-groups', 648 651 ); 649 652 … … 709 712 'screen_function' => 'groups_screen_group_home', 710 713 'default_subnav_slug' => $this->default_extension, 711 'item_css_id' => $this->id 714 'item_css_id' => $this->id, 712 715 ), 713 716 'groups' … … 824 827 825 828 /** This action is documented in bp-groups/bp-groups-loader.php */ 826 do_action( 'groups_setup_nav' );829 do_action( 'groups_setup_nav' ); 827 830 } 828 831 } … … 852 855 if ( bp_is_active( 'groups', 'invitations' ) ) { 853 856 // Pending group invites. 854 $count = groups_get_invite_count_for_user();857 $count = groups_get_invite_count_for_user(); 855 858 if ( $count ) { 856 859 $title = sprintf( … … 907 910 ) 908 911 ), 909 'position' => 90 912 'position' => 90, 910 913 ); 911 914 } … … 925 928 $bp = buddypress(); 926 929 927 if ( bp_is_my_profile() && ! bp_is_single_item() ) {930 if ( bp_is_my_profile() && ! bp_is_single_item() ) { 928 931 $bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' ); 929 932 930 } elseif ( !bp_is_my_profile() && !bp_is_single_item() ) { 931 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 932 'item_id' => bp_displayed_user_id(), 933 'type' => 'thumb', 934 'alt' => sprintf( 933 } elseif ( ! bp_is_my_profile() && ! bp_is_single_item() ) { 934 $bp->bp_options_avatar = bp_core_fetch_avatar( 935 array( 936 'item_id' => bp_displayed_user_id(), 937 'type' => 'thumb', 938 'alt' => sprintf( 935 939 /* translators: %s: member name */ 936 __( 'Profile picture of %s', 'buddypress' ), 937 bp_get_displayed_user_fullname() 938 ), 939 ) ); 940 $bp->bp_options_title = bp_get_displayed_user_fullname(); 941 942 // We are viewing a single group, so set up the 943 // group navigation menu using the $this->current_group global. 940 __( 'Profile picture of %s', 'buddypress' ), 941 bp_get_displayed_user_fullname() 942 ), 943 ) 944 ); 945 $bp->bp_options_title = bp_get_displayed_user_fullname(); 946 947 // We are viewing a single group, so set up the 948 // group navigation menu using the $this->current_group global. 944 949 } elseif ( bp_is_single_item() ) { 945 950 $bp->bp_options_title = $this->current_group->name; 946 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 947 'item_id' => $this->current_group->id, 948 'object' => 'group', 949 'type' => 'thumb', 950 'avatar_dir' => 'group-avatars', 951 'alt' => __( 'Group Profile Photo', 'buddypress' ) 952 ) ); 951 $bp->bp_options_avatar = bp_core_fetch_avatar( 952 array( 953 'item_id' => $this->current_group->id, 954 'object' => 'group', 955 'type' => 'thumb', 956 'avatar_dir' => 'group-avatars', 957 'alt' => __( 'Group Profile Photo', 'buddypress' ), 958 ) 959 ); 953 960 954 961 if ( empty( $bp->bp_options_avatar ) ) { … … 1028 1035 1029 1036 $rewrite_rules = array( 1030 'directory_type' => array(1037 'directory_type' => array( 1031 1038 'regex' => $this->root_slug . '/' . bp_get_groups_group_type_base() . '/([^/]+)/?$', 1032 1039 'order' => 50, 1033 1040 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['directory_type'] . '=$matches[1]', 1034 1041 ), 1035 'create_single_item' => array(1042 'create_single_item' => array( 1036 1043 'regex' => $this->root_slug . '/' . $create_slug . '/?$', 1037 1044 'order' => 40, … … 1040 1047 'create_single_item_variables' => array( 1041 1048 'regex' => $this->root_slug . '/' . $create_slug . '/(.+?)/?$', 1042 'order' => 30,1049 'order' => 30, 1043 1050 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['create_single_item'] . '=1&' . $this->rewrite_ids['create_single_item_variables'] . '=$matches[1]', 1044 1051 ), … … 1239 1246 public function rest_api_init( $controllers = array() ) { 1240 1247 $controllers = array( 1241 'BP_ REST_Groups_Endpoint',1242 'BP_ REST_Group_Membership_Endpoint',1243 'BP_ REST_Group_Invites_Endpoint',1244 'BP_ REST_Group_Membership_Request_Endpoint',1245 'BP_ REST_Attachments_Group_Avatar_Endpoint',1248 'BP_Groups_REST_Controller', 1249 'BP_Groups_Avatar_REST_Controller', 1250 'BP_Groups_Membership_REST_Controller', 1251 'BP_Groups_Membership_Request_REST_Controller', 1252 'BP_Groups_Invites_REST_Controller', 1246 1253 ); 1247 1254 1248 1255 // Support to Group Cover. 1249 1256 if ( bp_is_active( 'groups', 'cover_image' ) ) { 1250 $controllers[] = 'BP_ REST_Attachments_Group_Cover_Endpoint';1257 $controllers[] = 'BP_Groups_Cover_REST_Controller'; 1251 1258 } 1252 1259 … … 1266 1273 parent::blocks_init( 1267 1274 array( 1268 'bp/group' => array(1275 'bp/group' => array( 1269 1276 'metadata' => trailingslashit( buddypress()->plugin_dir ) . 'bp-groups/blocks/group', 1270 1277 'render_callback' => 'bp_groups_render_group_block', 1271 1278 ), 1272 'bp/groups' => array(1279 'bp/groups' => array( 1273 1280 'metadata' => trailingslashit( buddypress()->plugin_dir ) . 'bp-groups/blocks/groups', 1274 1281 'render_callback' => 'bp_groups_render_groups_block',
Note: See TracChangeset
for help on using the changeset viewer.