I'm using a plugin called Latest Tweet Widget to display the latest tweet. The tweet date gets displayed by the month and day (Mar 22). However, I want it to be in "Twitter time" meaning words like "3 days ago, 1 hour ago, etc.".
I asked the developer of the plugin at the WordPress forums and he said that I need to "use the latest_tweets_render_date
filter to perform my own relative date representation."
The filter in question is here under the "Custom HTML" section (also quoted below): https://wordpress.org/plugins/latest-tweets-widget/other_notes/#Theming
add_filter('latest_tweets_render_date', function( $created_at ){
$date = DateTime::createFromFormat('D M d H:i:s O Y', $created_at );
return $date->format('d M h:ia'); }, 10 , 1 );
However, I am new to PHP and unable to understand what exactly needs to be written in order for "Twitter time" to work. Can somebody please show me the way?