Changeset 2947 for branches/plugin/bbp-includes/bbp-topic-functions.php
- Timestamp:
- 03/01/2011 05:56:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-functions.php
r2933 r2947 345 345 346 346 /** 347 * Handles new topic submission from within wp-admin 348 * 349 * @param int $post_id 350 * @param obj $post 351 * 352 * @uses bbp_get_topic_post_type() 353 * @uses bbp_update_topic() 354 */ 355 function bbp_new_topic_admin_handler( $post_id, $post ) { 356 global $bbp; 357 358 if ( // Check if POST action 359 'POST' === $_SERVER['REQUEST_METHOD'] && 360 361 // Check Actions exist in POST 362 !empty( $_POST['action'] ) && 363 !empty( $_POST['post_type'] ) && 364 365 // Check that actions match what we need 366 'editpost' === $_POST['action'] && 367 bbp_get_topic_post_type() === $_POST['post_type'] 368 ) { 369 370 // Update the topic meta bidness 371 bbp_update_topic( $post_id, (int) $_POST['parent_id'] ); 372 } 373 } 374 375 /** 347 376 * Handle all the extra meta stuff from posting a new topic 348 377 * … … 372 401 */ 373 402 function bbp_update_topic( $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false ) { 403 374 404 // Validate the ID's passed from 'bbp_new_topic' action 375 405 $topic_id = bbp_get_topic_id( $topic_id ); 376 406 $forum_id = bbp_get_forum_id( $forum_id ); 407 408 // Check author_id 377 409 if ( empty( $author_id ) ) 378 410 $author_id = bbp_get_current_user_id(); 411 412 // Check forum_id 413 if ( empty( $forum_id ) ) 414 $forum_id = bbp_get_topic_forum_id( $topic_id ); 379 415 380 416 // If anonymous post, store name, email, website and ip in post_meta. … … 1362 1398 else 1363 1399 $topic_id = bbp_get_topic_id( $topic_id ); 1364 1365 $forum_id = bbp_get_forum_id( $forum_id );1366 1400 1367 1401 if ( empty( $forum_id ) )
Note: See TracChangeset
for help on using the changeset viewer.