Ticket #3417: 3417.patch
File 3417.patch, 1.6 KB (added by , 3 years ago) |
---|
-
src/includes/extend/buddypress/groups.php
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 97 97 add_action( 'groups_before_delete_group', array( $this, 'disconnect_forum_from_group' ) ); … … 860 860 } 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 867 * @param BP_Groups_Group $group Group object. 868 868 */ 869 public static function update_group_forum _visibility( BP_Groups_Group $group ) {869 public static function update_group_forum( BP_Groups_Group $group ) { 870 870 871 871 // Get group forum IDs 872 872 $forum_ids = bbp_get_group_forum_ids( $group->id ); … … 904 904 } 905 905 } 906 906 } 907 908 // Maybe update the first group forum title, content, and slug 909 if ( ! empty( $forum_ids[0] ) ) { 910 wp_update_post( array( 911 'ID' => $forum_ids[0], 912 'post_title' => $group->name, 913 'post_content' => $group->description, 914 'post_name' => $group->slug 915 ) ); 916 } 907 917 } 908 918 909 919 /**