BP_Messages_Component::setup_globals( array $args = array() )
Set up globals for the Messages component.
Description
The BP_MESSAGES_SLUG constant is deprecated, and only used here for backwards compatibility.
Parameters
- $args
-
(Optional) Not used.
Default value: array()
Source
File: bp-messages/classes/class-bp-messages-component.php
public function setup_globals( $args = array() ) {
$bp = buddypress();
// Define a slug, if necessary.
if ( ! defined( 'BP_MESSAGES_SLUG' ) ) {
define( 'BP_MESSAGES_SLUG', $this->id );
}
// Global tables for messaging component.
$global_tables = array(
'table_name_notices' => $bp->table_prefix . 'bp_messages_notices',
'table_name_messages' => $bp->table_prefix . 'bp_messages_messages',
'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients',
'table_name_meta' => $bp->table_prefix . 'bp_messages_meta',
);
// Metadata tables for messaging component.
$meta_tables = array(
'message' => $bp->table_prefix . 'bp_messages_meta',
);
$this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' );
// All globals for messaging component.
// Note that global_tables is included in this array.
parent::setup_globals( array(
'slug' => BP_MESSAGES_SLUG,
'has_directory' => false,
'notification_callback' => 'messages_format_notifications',
'search_string' => __( 'Search Messages…', 'buddyboss' ),
'global_tables' => $global_tables,
'meta_tables' => $meta_tables
) );
}
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.