Activity::the_when()
Description #
Output human readable date.
This is a wrapper for method @see AnsPress\Activity::when() but it output date only when previous activity in loop when value is not same.
Source #
File: includes/class/class-activity.php
public function the_when() { $current_when = $this->when( $this->object ); if ( $this->current > 0 && isset( $this->objects[ $this->current - 1 ] ) ) { $last_when = $this->when( $this->objects[ $this->current - 1 ] ); if ( $last_when === $current_when ) { return; } } echo '<div class="ap-activity-when">' . esc_html( $current_when ) . '</div>'; }
Expand full source code Collapse full source code View on GitHub: includes/class/class-activity.php:509
Add your comment