Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2013 05:57:50 AM (9 years ago)
Author:
johnjamesjacoby
Message:

If notification date is empty, be smarter about date output. See #5148.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-notifications/bp-notifications-template.php

    r7526 r7534  
    527527     */
    528528    function bp_get_the_notification_time_since() {
    529         return apply_filters( 'bp_get_the_notification_time_since', bp_core_time_since( bp_get_the_notification_date_notified() ) );
     529
     530        // Get the notified date
     531        $date_notified = bp_get_the_notification_date_notified();
     532
     533        // Notified date has legitimate data
     534        if ( '0000-00-00 00:00:00' !== $date_notified ) {
     535            $retval = bp_core_time_since( $date_notified );
     536           
     537        // Notified date is empty, so return a fun string
     538        } else {
     539            $retval = __( 'Date not found', 'buddypress' );
     540        }
     541
     542        return apply_filters( 'bp_get_the_notification_time_since', $retval );
    530543    }
    531544
Note: See TracChangeset for help on using the changeset viewer.