Changeset 6329
- Timestamp:
- 02/26/2017 11:06:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/update.php
r6325 r6329 183 183 function bbp_create_initial_content( $args = array() ) { 184 184 185 // Current user ID 186 $user_id = bbp_get_current_user_id(); 187 185 188 // Parse arguments against default values 186 189 $r = bbp_parse_args( $args, array( 190 'forum_author' => $user_id, 187 191 'forum_parent' => 0, 188 192 'forum_status' => 'publish', 189 'forum_title' => __( 'General', 'bbpress' ), 190 'forum_content' => __( 'General chit-chat', 'bbpress' ), 193 'forum_title' => __( 'General', 'bbpress' ), 194 'forum_content' => __( 'General chit-chat', 'bbpress' ), 195 196 'topic_author' => $user_id, 191 197 'topic_title' => __( 'Hello World!', 'bbpress' ), 192 198 'topic_content' => __( 'I am the first topic in your new forums.', 'bbpress' ), 199 200 'reply_author' => $user_id, 193 201 'reply_content' => __( 'Oh, and this is what a reply looks like.', 'bbpress' ), 194 202 ), 'create_initial_content' ); … … 196 204 // Use the same time for each post 197 205 $current_time = time(); 198 $forum_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 80 );199 $topic_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 60 );200 $reply_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 40 );206 $forum_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 80 ); 207 $topic_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 60 ); 208 $reply_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 40 ); 201 209 202 210 // Create the initial forum 203 211 $forum_id = bbp_insert_forum( array( 212 'post_author' => $r['forum_author'], 204 213 'post_parent' => $r['forum_parent'], 205 214 'post_status' => $r['forum_status'], … … 212 221 $topic_id = bbp_insert_topic( 213 222 array( 223 'post_author' => $r['topic_author'], 214 224 'post_parent' => $forum_id, 215 225 'post_title' => $r['topic_title'], 216 226 'post_content' => $r['topic_content'], 217 'post_date' => $topic_time 227 'post_date' => $topic_time, 218 228 ), 219 229 array( … … 225 235 $reply_id = bbp_insert_reply( 226 236 array( 237 'post_author' => $r['reply_author'], 227 238 'post_parent' => $topic_id, 228 239 'post_content' => $r['reply_content'],
Note: See TracChangeset
for help on using the changeset viewer.