" " - ,
, .
hook_preprocess_status_messages () passes in $ variables, but messages are not in $ variables, change them in $ _SESSION ['messages'].
function MYMODULE_preprocess_status_messages(&$variables) {
if (isset($_SESSION['messages']['warning'])) {
foreach ($_SESSION['messages']['warning'] as $key => $msg) {
if (strpos($msg, 'some text in the message') !== FALSE) {
$_SESSION['messages']['warning'][$key] = t(
'Your new message with a <a href="@link">link</a>.',
array('@link' => url('admin/something'))
);
}
}
}
}
Credit Parvind Sharma , where I found part of this solution.
source
share