[wp-trac] [WordPress Trac] #12738: Notice Helper

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 12 08:40:29 UTC 2011

#12738: Notice Helper
 Reporter:  andddd           |       Owner:  john316media
     Type:  feature request  |      Status:  accepted
 Priority:  lowest           |   Milestone:  Future Release
Component:  Plugins          |     Version:
 Severity:  minor            |  Resolution:
 Keywords:  has-patch        |

Comment (by john316media):

 As is each message I need to show requires 4 lines of code

 add_action('admin_notices', 'some_function_name');
 function some_function_name() {
     echo '<div id="message" class="updated"><p>Hello World!</p></div>';

 At its simplest, this way to make the same message all it would take is

 add_admin_notice('updated', 'Hello World!');

 What looks simpler to you?  4 lines becomes 1 line, multiply this by the
 number fo messages a given plugin needs to display and thats alot of extra
 typing saved for the plugin authoer, makes things easier and does this
 really overbloat core?  I personally don't think so.

Ticket URL: <http://core.trac.wordpress.org/ticket/12738#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list