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

Set up component global data.

Description

See also

Parameters

$args

(array) (Optional) See BP_Component::setup_globals() for a description.

Default value: array()

Source

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

	public function setup_globals( $args = array() ) {
		$bp = buddypress();

		// Define a slug, if necessary.
		if ( ! defined( 'BP_NOTIFICATIONS_SLUG' ) ) {
			define( 'BP_NOTIFICATIONS_SLUG', $this->id );
		}

		// Global tables for the notifications component.
		$global_tables = array(
			'table_name'      => $bp->table_prefix . 'bp_notifications',
			'table_name_meta' => $bp->table_prefix . 'bp_notifications_meta',
		);

		// Metadata tables for notifications component.
		$meta_tables = array(
			'notification' => $bp->table_prefix . 'bp_notifications_meta',
		);

		// All globals for the notifications component.
		// Note that global_tables is included in this array.
		$args = array(
			'slug'          => BP_NOTIFICATIONS_SLUG,
			'has_directory' => false,
			'search_string' => __( 'Search Notifications...', 'buddyboss' ),
			'global_tables' => $global_tables,
			'meta_tables'   => $meta_tables
		);

		parent::setup_globals( $args );
	}

Changelog

Changelog
Version Description
BuddyPress 1.9.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.