diff --git a/src/bp-groups/bp-groups-functions.php b/src/bp-groups/bp-groups-functions.php
index af9bdcf..1655ee4 100644
a
|
b
|
function groups_create_group( $args = '' ) { |
104 | 104 | 'name' => '', |
105 | 105 | 'description' => '', |
106 | 106 | 'slug' => '', |
107 | | 'status' => 'public', |
108 | | 'parent_id' => 0, |
109 | | 'enable_forum' => 0, |
110 | | 'date_created' => bp_core_current_time() |
| 107 | 'status' => null, |
| 108 | 'parent_id' => null, |
| 109 | 'enable_forum' => null, |
| 110 | 'date_created' => null |
111 | 111 | ); |
112 | 112 | |
113 | 113 | $args = wp_parse_args( $args, $defaults ); |
… |
… |
function groups_create_group( $args = '' ) { |
120 | 120 | $slug = ! empty( $slug ) ? $slug : $group->slug; |
121 | 121 | $creator_id = ! empty( $creator_id ) ? $creator_id : $group->creator_id; |
122 | 122 | $description = ! empty( $description ) ? $description : $group->description; |
| 123 | $status = ! is_null( $status ) ? $status : $group->status; |
| 124 | $parent_id = ! is_null( $parent_id ) ? $parent_id : $group->parent_id; |
| 125 | $enable_forum = ! is_null( $enable_forum ) ? $enable_forum : $group->enable_forum; |
| 126 | $date_created = ! is_null( $date_created ) ? $date_created : $group->date_created; |
123 | 127 | |
124 | 128 | // Groups need at least a name. |
125 | 129 | if ( empty( $name ) ) { |
… |
… |
function groups_create_group( $args = '' ) { |
130 | 134 | } else { |
131 | 135 | // Instantiate new group object. |
132 | 136 | $group = new BP_Groups_Group; |
| 137 | |
| 138 | // Check for null values, reset to sensible defaults. |
| 139 | $status = ! is_null( $status ) ? $status : 'public'; |
| 140 | $parent_id = ! is_null( $parent_id ) ? $parent_id : 0; |
| 141 | $enable_forum = ! is_null( $enable_forum ) ? $enable_forum : 0; |
| 142 | $date_created = ! is_null( $date_created ) ? $date_created : bp_core_current_time(); |
133 | 143 | } |
134 | 144 | |
135 | 145 | // Set creator ID. |