bp_nouveau_notifications_register_filter( array $args = array() )

Register new filters for the notifications screens.

Description

Parameters

$args

(array) (Optional) Array of arguments.

  • 'id'
    (string) The unique string to identify your "component action". Required.
  • 'label'
    (string) The human readable notification type. Required.
  • 'position'
    (int) The position to output your filter. Optional.

Default value: array()

Return

(bool) True if the filter has been successfully registered. False otherwise.

Source

File: bp-templates/bp-nouveau/includes/notifications/functions.php

function bp_nouveau_notifications_register_filter( $args = array() ) {
	$bp_nouveau = bp_nouveau();

	$r = wp_parse_args( $args, array(
		'id'       => '',
		'label'    => '',
		'position' => 99,
	) );

	if ( empty( $r['id'] ) || empty( $r['label'] ) ) {
		return false;
	}

	if ( isset( $bp_nouveau->notifications->filters[ $r['id'] ] ) ) {
		return false;
	}

	$bp_nouveau->notifications->filters[ $r['id'] ] = $r;
	return true;
}

Changelog

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