mycred_after_notifications

Codex / mycred/notice / Actions / mycred_after_notifications

Description

This action fires after the myCRED Notifications add-on has echoed all new notifications on the front end. See also the mycred_before_notifications action.

Available since version 1.2

Parameters

Param Type Required Description
$notifications array No

Associative array of notifications that has just been shown to the user.

Used By

Package Prio. Description
Not used by any built-in package.

Examples

Example 1: Show a ``No new notifications`` message if a use does not have any notifications.

add_action( 'mycred_after_notifications', 'mycredpro_after_notifications' );
function mycredpro_after_notifications( $notifications ) {

	if ( empty( $notifications ) )
		echo '<!-- Notice --><script type="text/javascript">(function(jQuery){jQuery.noticeAdd({ text: "No new notifications",stay: true });})(jQuery);</script>';

}

Last edited March 6, 2016