Changeset 7210 for trunk/src/includes/extend/buddypress/groups.php
- Timestamp:
- 09/21/2021 03:14:26 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/groups.php
r7098 r7210 87 87 add_action( 'bbp_after_group_forum_display', array( $this, 'remove_group_forum_meta_cap_map' ) ); 88 88 89 // Validate group forumIDs when editing topics & replies89 // Validate group IDs when editing topics & replies 90 90 add_action( 'bbp_edit_topic_pre_extras', array( $this, 'validate_topic_forum_id' ) ); 91 91 add_action( 'bbp_edit_reply_pre_extras', array( $this, 'validate_reply_to_id' ) ); 92 92 93 // Check if group-forum status should be changed94 add_action( 'groups_group_after_save', array( $this, 'update_group_forum _visibility') );93 // Check if group-forum attributes should be changed 94 add_action( 'groups_group_after_save', array( $this, 'update_group_forum' ) ); 95 95 96 96 // bbPress needs to listen to BuddyPress group deletion … … 861 861 862 862 /** 863 * Set forums' status to match the privacy status of the associated group863 * Update forum attributes to match those of the associated group. 864 864 * 865 865 * Fired whenever a group is saved 866 866 * 867 * @since 2.6.7 bbPress (r7208) 868 * 867 869 * @param BP_Groups_Group $group Group object. 868 870 */ 869 public static function update_group_forum _visibility( BP_Groups_Group $group ) {871 public static function update_group_forum( BP_Groups_Group $group ) { 870 872 871 873 // Get group forum IDs … … 903 905 break; 904 906 } 907 } 908 } 909 910 // Maybe update the first group forum title, content, and slug 911 if ( ! empty( $forum_ids[0] ) ) { 912 913 // Get forum from ID 914 $forum = bbp_get_forum( $forum_ids[0] ); 915 916 // Only update the forum if changes are being made 917 if ( 918 919 // Title 920 ( $forum->post_title !== $group->name ) 921 922 || 923 924 // Content 925 ( $forum->post_content !== $group->description ) 926 927 || 928 929 // Slug 930 ( $forum->post_name !== $group->slug ) 931 ) { 932 wp_update_post( 933 array( 934 'ID' => $forum->ID, 935 'post_title' => $group->name, 936 'post_content' => $group->description, 937 'post_name' => $group->slug 938 ) 939 ); 905 940 } 906 941 }
Note: See TracChangeset
for help on using the changeset viewer.