Changeset 13466 for trunk/src/bp-activity/classes/class-bp-akismet.php
- Timestamp:
- 04/30/2023 07:40:12 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-akismet.php
r13436 r13466 668 668 $history = BP_Akismet::get_activity_history( $item->id ); 669 669 670 if ( empty( $history ) ) 671 return; 672 673 echo '<div class="akismet-history"><div>'; 674 /* translators: 1: the human diff time. 2: the akismet history data. */ 675 printf( _x( '%1$s — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history[2] ) . '</span>', esc_html( $history[1] ) ); 676 echo '</div></div>'; 670 if ( empty( $history ) ) { 671 $message = '—'; 672 } else { 673 /* translators: 1: the human diff time. 2: the akismet history data. */ 674 $message = sprintf( _x( '%1$s — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history['time'] ) . '</span>', esc_html( $history['message'] ) ); 675 } 676 677 printf( '<div class="akismet-history"><div>%s</div></div>', wp_kses( $message, array( 'span' => true ) ) ); 677 678 } 678 679 … … 708 709 public function get_activity_history( $activity_id = 0 ) { 709 710 $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' ); 710 if ( $history === false ) 711 if ( $history && is_array( $history ) && isset( $history['time'] ) ) { 712 $history['time'] = (int) $history['time']; 713 } else { 711 714 $history = array(); 712 713 // Sort it by the time recorded. 714 usort( $history, 'akismet_cmp_time' ); 715 } 715 716 716 717 return $history;
Note: See TracChangeset
for help on using the changeset viewer.