Skip to:
Content

bbPress.org

Ticket #2339: 2339.01.patch

File 2339.01.patch, 1.4 KB (added by r-a-y, 9 years ago)
  • includes/extend/buddypress/group.php

    class BBP_Forums_Group_Extension extends BP_Group_Extension { 
    9595
    9696                // Saves the bbPress options if they come from the BuddyPress Group Admin UI
    9797                add_action( 'bp_group_admin_edit_after',     array( $this, 'edit_screen_save'                ) );
     98
     99                // Adds a hidden input value to the "Group Settings" page
     100                add_action( 'bp_before_group_settings_admin', array( $this, 'group_settings_hidden_field'    ) );
    98101        }
    99102
    100103        /**
    class BBP_Forums_Group_Extension extends BP_Group_Extension { 
    10671070                return $retval;
    10681071        }
    10691072
     1073        /**
     1074         * Add a hidden input field on the group settings page if the group forum is
     1075         * enabled.
     1076         *
     1077         * Due to the way BuddyPress' group admin settings page saves its settings, we
     1078         * need to let BP know that bbPress added a forum.
     1079         *
     1080         * @since bbPress (rxxxx)
     1081         *
     1082         * @see groups_screen_group_admin_settings()
     1083         */
     1084        public function group_settings_hidden_field() {
     1085                // if a forum is not enabled, we don't need to add this field
     1086                if ( ! bp_group_is_forum_enabled() ) {
     1087                        return;
     1088                }
     1089        ?>
     1090                <input type="hidden" name="group-show-forum" id="group-show-forum" value="1" />
     1091       
     1092        <?php
     1093        }
     1094
    10701095        /** Permalink Mappers *****************************************************/
    10711096
    10721097        /**