BP_Friends_Component::setup_globals( array $args = array() )

Set up bp-friends global settings.

Description

The BP_FRIENDS_SLUG constant is deprecated, and only used here for backwards compatibility.

See also

Parameters

$args

(Optional) See BP_Component::setup_globals().

Default value: array()

Source

File: bp-friends/classes/class-bp-friends-component.php

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
public function setup_globals( $args = array() ) {
    $bp = buddypress();
 
    // Deprecated. Do not use.
    // Defined conditionally to support unit tests.
    if ( ! defined( 'BP_FRIENDS_DB_VERSION' ) ) {
        define( 'BP_FRIENDS_DB_VERSION', '1800' );
    }
 
    // Define a slug, if necessary.
    if ( ! defined( 'BP_FRIENDS_SLUG' ) ) {
        define( 'BP_FRIENDS_SLUG', $this->id );
    }
 
    // Global tables for the friends component.
    $global_tables = array(
        'table_name'          => $bp->table_prefix . 'bp_friends',
        'table_name_meta'     => $bp->table_prefix . 'bp_friends_meta',
    );
 
    // All globals for the friends component.
    // Note that global_tables is included in this array.
    $args = array(
        'slug'                  => BP_FRIENDS_SLUG,
        'has_directory'         => false,
        'search_string'         => __( 'Search Connections…', 'buddyboss' ),
        'notification_callback' => 'friends_format_notifications',
        'global_tables'         => $global_tables
    );
 
    parent::setup_globals( $args );
}

Changelog

Changelog
Version Description
BuddyPress 1.5.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.