Skip to:
Content

BuddyPress.org

Changeset 11793


Ignore:
Timestamp:
01/05/2018 12:17:30 PM (7 years ago)
Author:
djpaul
Message:

Activity: prevent repeat calls to bp_activity_get_actions() when fetching post type tracking settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r11764 r11793  
    749749    $bp = buddypress();
    750750
    751     $post_types = bp_activity_get_post_types_tracking_args();
     751    // Set the activity track global if not set yet.
     752    if ( empty( $bp->activity->track ) ) {
     753        $bp->activity->track = bp_activity_get_post_types_tracking_args();
     754    }
    752755
    753756    // Create the actions for the post types, if they haven't already been created.
    754     if ( ! empty( $post_types ) ) {
    755         foreach ( $post_types as $post_type ) {
     757    if ( ! empty( $bp->activity->track ) ) {
     758        foreach ( $bp->activity->track as $post_type ) {
    756759            if ( isset( $bp->activity->actions->{$post_type->component_id}->{$post_type->action_id} ) ) {
    757760                continue;
Note: See TracChangeset for help on using the changeset viewer.