You could also do it using human_time_diff
hook, but it would make it global:
function my_time_diff_mins( $since, $diff, $from, $to ) {
return $since . ($from > $to ? ' from now' : ' ago');
}
add_filter( 'human_time_diff', 'my_time_diff_mins', 10, 4 );
Related Posts:
- Customize Time Stamp
- display month in french in wordpress/php?
- How to get User Time Zone in WordPress?
- How to get movies by date
- current_time function incorrect in plugin and PHP, not in WordPress admin
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- Learndash: Customize user enroll time
- Can’t add to time? [closed]
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Cleaning up WordPress to improve performance?
- How build a custom login/register form with error handling?
- Network installation giving errors when viewing or adding a user
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- List all categories but exclude current post category on single post page
- Woocommerce, recognize the loop of related products
- Using FirePHP with WordPress
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Append a term to WooCommerce product existing product category terms
- WordPress different language footer text
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- WordPress blockquote removes “ tag
- How do I target the child theme with get_bloginfo();?
- If Meta Checkbox is checked, do something?
- Output 2 items within the Loop
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- Can I use HTTP POSTs? Is there a better alternative?
- Will simple function names in a class structure conflict with other plugins?
- Getting a specific post values to another div or modal
- How can i upload images in an admin page?
- WordPress: Access a plugin from within a theme
- WP grandchild categories in nested ul li
- Modify HTML structure of fields in woocommerce checkout form
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to improve my WordPress filter to include empty custom fields
- Update results, Before deleting the related category [closed]
- wordpress archive a user
- How to change theme programmatically from a external application?
- How to Return in WordPress Function php file?
- Hide Featured Image Meta Box on Editor Screen
- Limit Taxonomy Output in Conditional Statement
- wp_redirect only works on main site and not on other sites
- I have a snippet to redirect all users to a maintenance page. How do I exclude users with admin role?
- How to filter custom taxonomy term name, slug, and description?
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- require_once() if a product in woocommerce contains a tag [closed]
- Is this a correct usage of ob_start() in my WordPress project?
- How do I get my Javascript scripts working?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Only show first image in foreach loop
- How to send a HTTP Post request using PHP Curl and WordPress
- How to suppress template-parts in undescores?
- How run a non-WordPress PHP Program on a WordPress site?
- Issue Enqueueing WordPress style.css
- Add valid XHTML closing img tags to WordPress galleries
- Show field if it has contents on Advanced Custom Fields
- Changing wordpress default language
- Class for Selected Menu using wp_nav_menu
- Contact form – problem with displaying message about sent mail
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- Prevent Buddypress Rewrite Rules on Non-Buddypress pages/posts
- Adding image upload in tag section – WordPress plugin development
- How do I set a hidden field to a value?
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- WordPress sorting posts by date and title using a dropdown
- How to output the taxonomies that are assigned to each custom post?
- Reading URL Parameters
- Issue in displaying the ongoing event and current events in the post
- Conditional formatting on data fetched from MYSQL
- opens like sitename.com/URL
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- Link to index.php from home.php?
- How do I remove an action hook inside a class that is called by another class?
- Merging Multiple WordPress Websites
- Replace an array (with identical values) with another array in the_content
- WordPress/NGINX not respecting the category URL for new posts
- Display current user metadata on WordPress page
- Need help transforming echo to return for use with shortcode
- PHP Error Backtrace / create_function deprecated
- Filtering markers on google map by WordPress category[SOLVED]
- scroll scrpit to particular button position to next id when click button
- What is wrong in this code?
- perform mathematical operation on shortcode
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Create page in templates for pages or the pages manager?
- wp_nav_menu prints children with parent name
- directorypress theme error mysql_error() [closed]
- wp add inline style in loop
- Do_shortcode on PHP file outside theme ALMOST works
- WordPress 2014 Theme – Featured Content with multiple tags?
- Does wp_query and query_posts affect website performance? [duplicate]
- Facebook share button only share the_permalink(), without thumbnail, tilte, excerpt, etc
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- ACF repeater image in video poster with jquery
- What is proper way to use the php if statement? [closed]
- Background Tasks in a WP Cronjob?
- How to execute a shortcode within a custom field?
- using custom pages for myaccount in woocommerce
- Putting form result in my database