bp_notifications_delete_all_notifications_by_type( int $item_id, string $component_name, string|bool $component_action = false, int|bool $secondary_item_id = false )

Delete all notifications by type.


Description Description

Used when clearing out notifications for an entire component.


Top ↑

Parameters Parameters

$item_id

(int) (Required) ID of the user whose notifications are being deleted.

$component_name

(string) (Required) Name of the associated component.

$component_action

(string|bool) (Optional) Name of the associated action.

Default value: false

$secondary_item_id

(int|bool) (Optional) ID of the secondary associated item.

Default value: false


Top ↑

Return Return

(int|false) True on success, false on failure.


Source Source

File: bp-notifications/bp-notifications-functions.php

function bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
	return BP_Notifications_Notification::delete( array(
		'item_id'           => $item_id,
		'secondary_item_id' => $secondary_item_id,
		'component_name'    => $component_name,
		'component_action'  => $component_action,
	) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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