Changeset 6528 for trunk/src/includes/topics/template.php
- Timestamp:
- 06/12/2017 05:29:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r6438 r6528 1881 1881 function bbp_get_topic_forum_id( $topic_id = 0 ) { 1882 1882 $topic_id = bbp_get_topic_id( $topic_id ); 1883 $forum_id = get_post_meta( $topic_id, '_bbp_forum_id', true ); 1883 $forum_id = get_post_field( 'post_parent', $topic_id ); 1884 1885 // Meta-data fallback 1886 if ( empty( $forum_id ) ) { 1887 $forum_id = get_post_meta( $topic_id, '_bbp_forum_id', true ); 1888 } 1889 1890 // Filter 1891 if ( ! empty( $forum_id ) ) { 1892 $forum_id = bbp_get_forum_id( $forum_id ); 1893 } 1884 1894 1885 1895 // Filter & return … … 3676 3686 $voice_count = sprintf( _n( '%s voice', '%s voices', $vc_int, 'bbpress' ), $voice_count ); 3677 3687 3678 // Topic has replies3679 $last_ reply = bbp_get_topic_last_reply_id( $topic_id );3680 if ( ! empty( $last_ reply) ) {3681 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_ reply, 'size' => $r['size'] ) );3682 $retstr = sprintf( esc_html__( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since);3688 // Topic has activity (could be from reply or topic author) 3689 $last_active = bbp_get_topic_last_active_id( $topic_id ); 3690 if ( ! empty( $last_active ) ) { 3691 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $r['size'] ) ); 3692 $retstr = sprintf( esc_html__( 'This topic has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $reply_count, $voice_count, $time_since, $last_updated_by ); 3683 3693 3684 3694 // Topic has no replies 3685 3695 } elseif ( ! empty( $voice_count ) && ! empty( $reply_count ) ) { 3686 $retstr = sprintf( esc_html__( 'This topic contains %1$s and has%2$s.', 'bbpress' ), $voice_count, $reply_count );3696 $retstr = sprintf( esc_html__( 'This topic has %1$s and %2$s.', 'bbpress' ), $voice_count, $reply_count ); 3687 3697 3688 3698 // Topic has no replies and no voices … … 4112 4122 4113 4123 /** 4114 * Allow topic rows to have admin strative actions4124 * Allow topic rows to have administrative actions 4115 4125 * 4116 4126 * @since 2.1.0 bbPress (r3653)
Note: See TracChangeset
for help on using the changeset viewer.