bp_nouveau_notifications_register_filter( array $args = array() )

Register new filters for the notifications screens.


Parameters 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()


Top ↑

Return Return

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


Source Source

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

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

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

	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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.