' . esc_html( (string) $count ) . '' ); ?>
$nonce,
'code' => $alert['code'],
'pum_dismiss_alert' => 'dismiss',
'expires' => $expires,
]
);
?>
' . esc_html( $action['text'] ) . '' : esc_html( $action['text'] );
if ( 'link' === $action['type'] ) {
$url = $action['href'] ?? '#';
$attributes = 'target="_blank" rel="noreferrer noopener"';
} else {
$url = add_query_arg(
[
'nonce' => $nonce,
'code' => $alert['code'],
'pum_dismiss_alert' => $action['action'],
'expires' => $expires,
]
);
$attributes = 'class="pum-dismiss"';
}
?>
- >
* }>
*/
public static function get_global_alerts() {
$alerts = self::get_alerts();
$global_alerts = [];
foreach ( $alerts as $alert ) {
if ( $alert['global'] ) {
$global_alerts[] = $alert;
}
}
return $global_alerts;
}
/**
* Get all alerts with defaults applied and filtered by dismissal status.
*
* @return array