Noptin_Automation_Rules_Table::column_created_at( Noptin_Automation_Rule $item )

Displays the rule’s creation date


Parameters Parameters

$item

(Noptin_Automation_Rule) (Required) item.


Top ↑

Return Return

(HTML)


Top ↑

Source Source

File: includes/automation-rules/class-noptin-automation-rules-table.php

	public function column_created_at( $item ) {

		$created   = strtotime( $item->created_at );
		$time_diff = current_time( 'timestamp' ) - $created;

		if ( $created && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
			$relative = sprintf(
				/* translators: %s: Human-readable time difference. */
				__( '%s ago', 'newsletter-optin-box' ),
				human_time_diff( $created, current_time( 'timestamp' ) )
			);
		} else {
			$relative = date_i18n( get_option( 'date_format' ), $created );
		}

		$date = esc_attr( date_i18n( 'Y/m/d g:i:s a', $created ) );
		return "<abbr title='$date'>$relative<abbr>";

	}

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation