[wp-hackers] Admin notices

Ryan McCue lists at rotorised.com
Mon Apr 11 13:00:14 UTC 2011


Ryan McCue wrote:
>         public function add_message($msg) {
>             $func = function () use ($msg) { echo $msg; }
>             self::$callbacks[] = $func;
>             add_action('admin_notices', $func);
>         }

Mind you, this comes to the same problem, where you need a helper
function. Personally, I'd go for just adding the callback and not
worrying about if another plugin wants to remove the notice. If they
really want it, I can add it in version x+1. :)


-- 
Ryan McCue
<http://ryanmccue.info/>



More information about the wp-hackers mailing list