Changeset 3125
- Timestamp:
- 05/09/2011 06:51:40 AM (15 years ago)
- Location:
- branches/plugin
- Files:
-
- 6 edited
-
bbp-admin/bbp-replies.php (modified) (2 diffs)
-
bbp-admin/bbp-topics.php (modified) (1 diff)
-
bbp-includes/bbp-reply-functions.php (modified) (1 diff)
-
bbp-includes/bbp-reply-template.php (modified) (2 diffs)
-
bbp-includes/bbp-topic-functions.php (modified) (1 diff)
-
bbp-includes/bbp-topic-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-replies.php
r3120 r3125 568 568 569 569 // Output forum name 570 bbp_topic_title( $topic_id ); 571 572 // Link information 573 $actions = apply_filters( 'reply_topic_row_actions', array ( 574 'edit' => '<a href="' . add_query_arg( array( 'post' => $topic_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>', 575 'view' => '<a href="' . bbp_get_topic_permalink( $topic_id ) . '">' . __( 'View', 'bbpress' ) . '</a>' 576 ) ); 577 578 // Output forum post row links 579 foreach ( $actions as $action => $link ) 580 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>'; 581 582 //echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>'; 570 if ( !empty( $topic_id ) ) { 571 bbp_topic_title( $topic_id ); 572 573 // Link information 574 $actions = apply_filters( 'reply_topic_row_actions', array ( 575 'edit' => '<a href="' . add_query_arg( array( 'post' => $topic_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>', 576 'view' => '<a href="' . bbp_get_topic_permalink( $topic_id ) . '">' . __( 'View', 'bbpress' ) . '</a>' 577 ) ); 578 579 // Output forum post row links 580 foreach ( $actions as $action => $link ) 581 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>'; 582 583 if ( !empty( $topic_id ) ) 584 echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>'; 585 586 // Reply has no topic 587 } else { 588 _e( '(No Topic)', 'bbpress' ); 589 } 583 590 584 591 break; … … 591 598 592 599 // Output forum name 593 bbp_forum_title( $forum_id ); 594 595 // Link information 596 $actions = apply_filters( 'reply_topic_forum_row_actions', array ( 597 'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>', 598 'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>' 599 ) ); 600 601 // Output forum post row links 602 foreach ( $actions as $action => $link ) 603 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>'; 604 605 //echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>'; 600 if ( !empty( $forum_id ) ) { 601 bbp_forum_title( $forum_id ); 602 603 // Link information 604 $actions = apply_filters( 'reply_topic_forum_row_actions', array ( 605 'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>', 606 'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>' 607 ) ); 608 609 // Output forum post row links 610 foreach ( $actions as $action => $link ) 611 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>'; 612 613 // Show forum actions 614 if ( !empty( $forum_id ) ) 615 echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>'; 616 617 // Reply has no forum 618 } else { 619 _e( '(No Forum)', 'bbpress' ); 620 } 606 621 607 622 break; -
branches/plugin/bbp-admin/bbp-topics.php
r3120 r3125 653 653 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>'; 654 654 655 //echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>';655 echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>'; 656 656 } else { 657 657 _e( '(No Forum)', 'bbpress' ); -
branches/plugin/bbp-includes/bbp-reply-functions.php
r3124 r3125 383 383 // Check that actions match what we need 384 384 'editpost' === $_POST['action'] && 385 'publish' === $_POST['post_status'] && 385 386 bbp_get_reply_post_type() === $_POST['post_type'] 387 386 388 ) { 387 389 -
branches/plugin/bbp-includes/bbp-reply-template.php
r3101 r3125 1071 1071 function bbp_get_reply_topic_id( $reply_id = 0 ) { 1072 1072 1073 // Assume there is no topic id 1074 $topic_id = 0; 1075 1073 1076 // Check that reply_id is valid 1074 if ( $reply_id = bbp_get_reply_id( $reply_id ) ) {1077 if ( $reply_id = bbp_get_reply_id( $reply_id ) ) 1075 1078 1076 1079 // Get topic_id from reply 1077 $topic_id = get_post_meta( $reply_id, '_bbp_topic_id', true ); 1078 $topic_id = bbp_get_topic_id( $topic_id ); 1079 1080 // reply_id is not valid, so no topic exists 1081 } else { 1082 $topic_id = 0; 1083 } 1080 if ( $topic_id = get_post_meta( $reply_id, '_bbp_topic_id', true ) ) 1081 1082 // Validate the topic_id 1083 $topic_id = bbp_get_topic_id( $topic_id ); 1084 1084 1085 1085 return apply_filters( 'bbp_get_reply_topic_id', (int) $topic_id, $reply_id ); … … 1111 1111 function bbp_get_reply_forum_id( $reply_id = 0 ) { 1112 1112 1113 // Assume there is no forum 1114 $forum_id = 0; 1115 1113 1116 // Check that reply_id is valid 1114 if ( $reply_id = bbp_get_reply_id( $reply_id ) ) {1117 if ( $reply_id = bbp_get_reply_id( $reply_id ) ) 1115 1118 1116 1119 // Get forum_id from reply 1117 $forum_id = get_post_meta( $reply_id, '_bbp_forum_id', true ); 1118 $forum_id = bbp_get_forum_id( $forum_id ); 1119 1120 // reply_id is not valid, so no forum exists 1121 } else { 1122 $forum_id = 0; 1123 } 1120 if ( $forum_id = get_post_meta( $reply_id, '_bbp_forum_id', true ) ) 1121 1122 // Validate the forum_id 1123 $forum_id = bbp_get_forum_id( $forum_id ); 1124 1124 1125 1125 return apply_filters( 'bbp_get_reply_forum_id', (int) $forum_id, $reply_id ); -
branches/plugin/bbp-includes/bbp-topic-functions.php
r3124 r3125 392 392 // Check that actions match what we need 393 393 'editpost' === $_POST['action'] && 394 'publish' === $_POST['post_status'] && 394 395 bbp_get_topic_post_type() === $_POST['post_type'] 395 396 ) { -
branches/plugin/bbp-includes/bbp-topic-template.php
r3113 r3125 1265 1265 $forum_id = get_post_meta( $topic_id, '_bbp_forum_id', true ); 1266 1266 1267 // Fallback to post_parent if no meta exists, and set post meta1268 if ( '' === $forum_id ) {1269 $forum_id = get_post_field( 'post_parent', $topic_id );1270 bbp_update_topic_forum_id( $topic_id, $forum_id );1271 }1272 1273 1267 return apply_filters( 'bbp_get_topic_forum_id', (int) $forum_id, $topic_id ); 1274 1268 }
Note: See TracChangeset
for help on using the changeset viewer.