[wp-hackers] Admin notices

John 3:16 Media wp at john316media.com
Mon Apr 11 06:41:48 UTC 2011


Oops I did not know that, see my last post, that's actually what I use.
Which means I'll have to redo how I do admin notices, back to the drawing
board as to how to do this simply without 4 lines of code and a new function
with lots of redundant code, which idk if that will be possible short of
some core implementation.

On Sun, Apr 10, 2011 at 11:35 PM, Andrew Nacin <wp at andrewnacin.com> wrote:

> On Mon, Apr 11, 2011 at 2:26 AM, Ryan McCue <lists at rotorised.com> wrote:
>
> > Rob Miller wrote:
> > > No need to target 5.3+; you can do anonymous functions in PHP 4.0+:
> > >
> > > add_action('admin_notices', create_function('', 'echo "your
> message";'));
> >
> > True, and good point! They just don't look as nice. ;)
>
>
> I would strongly recommend you avoid create_function() at all costs. It
> poses a pretty serious security risk when used improperly. It's a priority
> for us to remove all of them from the core codebase. (We're close.)
>
> I would also recommend (in general) you avoid closures. I use them in
> testing all the time -- add_action( 'init', function() { ... } ); -- but in
> a public plugin, it's not playing very nice with others, as the callback
> can't easily be removed.
>
> Nacin
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 

I'm working on a support ticket plugin and I'm looking for users to test and
provide feedback on it.  Will bribe anyone who helps with a generous
discount on the final product.  Email me off-list if interested.


More information about the wp-hackers mailing list