mycred_before_notifications

Codex / mycred/notice / Actions / mycred_before_notifications

Description

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

Available since version 1.2

Parameters

Param Type Required Description
$notifications array No

Associative array of notifications that are about to be 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_before_notifications', 'mycredpro_before_notifications' );
function mycredpro_before_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