Changeset 2923
- Timestamp:
- 02/20/2011 08:58:25 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-reply-functions.php
r2914 r2923 24 24 $forum_id = bbp_get_forum_id( $forum_id ); 25 25 26 // If no forum_id was passed, walk up ancestors and look for forum type 27 if ( empty( $topic_id ) ) { 28 $ancestors = get_post_ancestors( $reply_id ); 29 foreach ( $ancestors as $ancestor ) { 30 if ( get_post_field( 'post_parent', $ancestor ) == bbp_get_forum_post_type() ) { 31 $topic_id = $ancestor; 32 continue; 33 } 34 } 35 } 36 26 37 // Update the last reply ID 27 38 return update_post_meta( $reply_id, '_bbp_forum_id', (int) $forum_id ); … … 45 56 $reply_id = bbp_get_reply_id( $reply_id ); 46 57 $topic_id = bbp_get_topic_id( $topic_id ); 58 59 // If no topic_id was passed, walk up ancestors and look for topic type 60 if ( empty( $topic_id ) ) { 61 $ancestors = get_post_ancestors( $reply_id ); 62 foreach ( $ancestors as $ancestor ) { 63 if ( get_post_field( 'post_parent', $ancestor ) == bbp_get_topic_post_type() ) { 64 $topic_id = $ancestor; 65 continue; 66 } 67 } 68 } 47 69 48 70 // Update the last reply ID
Note: See TracChangeset
for help on using the changeset viewer.