Manual:Hooks/SiteNoticeBefore

Details

 * $siteNotice: Empty string, ignored if the hook returns true.
 * $skin: Skin object

If the function returns false, no attempt will be done to load the sitenotice from interface messages or, and the contents of $siteNotice will be used instead. If the function returns true, there will be no change in behavior of the sitenotice.

Example
If the database is read only and there's a sitenotice in MediaWiki:Sitenotice you want to override, you can use this hook for that purpose: