[wp-meta] [Making WordPress.org] #5121: Fix support forum dates title and datetime attributes

Making WordPress.org noreply at wordpress.org
Tue Mar 31 09:22:44 UTC 2020


#5121: Fix support forum dates title and datetime attributes
----------------------------+---------------------
 Reporter:  TweetyThierry   |       Owner:  (none)
     Type:  defect          |      Status:  new
 Priority:  normal          |   Milestone:
Component:  Support Forums  |  Resolution:
 Keywords:  needs-patch     |
----------------------------+---------------------

Comment (by TweetyThierry):

 I believe this is the template line
 https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/themes/pub/wporg-forums/bbpress/loop-single-reply.php#L39
 which needs to be updated.

 Since to my knowledge there isn't a core bbPress function to get the last
 reply date, we may have to add a helper function, something similar to
 `bbp_get_topic_last_active_time()` but returning the date or timestamp.
 For example:


 {{{
 function bb_base_get_topic_last_active_timestamp( $topic_id = 0 ) {
         $topic_id = bbp_get_topic_id( $topic_id );

         // Try to get the most accurate freshness time possible.
         $last_active = get_post_meta( $topic_id, '_bbp_last_active_time',
 true );

         if ( empty( $last_active ) ) {
                 $reply_id = bbp_get_topic_last_reply_id( $topic_id );

                 if ( ! empty( $reply_id ) ) {
                         return get_post_field( 'post_date', $reply_id );
                 } else {
                         return get_post_field( 'post_date', $topic_id );
                 }
         }
 }
 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5121#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list