Skip to:
Content

BuddyPress.org

Changeset 8998


Ignore:
Timestamp:
09/10/2014 05:07:46 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Bring bp_get_blog_last_active() up to parity with bp_get_member_last_active() for 2.1.

Also fix speeling error in bp_get_member_last_active().

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r8942 r8998  
    661661        global $blogs_template;
    662662
    663         $r = wp_parse_args( $args, array(
    664             'active_format' => true,
     663        // Parse the activity format
     664        $r = bp_parse_args( $args, array(
     665            'active_format' => true
    665666        ) );
    666667
     668        // Backwards compatibilty for anyone forcing a 'true' active_format
     669        if ( true === $r['active_format'] ) {
     670            $r['active_format'] = __( 'active %s', 'buddypress' );
     671        }
     672
     673        // Blog has logged in at least one time
    667674        if ( isset( $blogs_template->blog->last_activity ) ) {
    668             if ( ! empty( $r['active_format'] ) ) {
    669                 $last_activity = bp_core_get_last_activity( $blogs_template->blog->last_activity, __( 'active %s', 'buddypress' ) );
    670             } else {
    671                 $last_activity = bp_core_time_since( $blogs_template->blog->last_activity );
    672             }
     675
     676            // Backwards compatibility for pre 1.5 'ago' strings
     677            $last_activity = ! empty( $r['active_format'] )
     678                ? bp_core_get_last_activity( $blogs_template->blog->last_activity, $r['active_format'] )
     679                : bp_core_time_since( $blogs_template->blog->last_activity );
     680
     681        // Blog has never logged in or been active
    673682        } else {
    674683            $last_activity = __( 'Never active', 'buddypress' );
  • trunk/src/bp-members/bp-members-template.php

    r8973 r8998  
    825825        global $members_template;
    826826
    827         // Parse the activy format
     827        // Parse the activity format
    828828        $r = bp_parse_args( $args, array(
    829829            'active_format' => true
Note: See TracChangeset for help on using the changeset viewer.