[wp-trac] [WordPress Trac] #12738: Notice Helper
WordPress Trac
wp-trac at lists.automattic.com
Sun Mar 28 00:07:59 UTC 2010
#12738: Notice Helper
-------------------------+--------------------------------------------------
Reporter: andddd | Owner: westi
Type: enhancement | Status: new
Priority: lowest | Milestone: 2.9.3
Component: Plugins | Version:
Severity: minor | Keywords:
-------------------------+--------------------------------------------------
It would be useful if the next WP release will contain notice helper
function in plugins API or somewhere in WP utils.
All plugin developers are often using standard WP admin notices which is
simply a line of HTML:
{{{
<div class="updated fade"><p>Some message.</p></div>
}}}
I didn't find any function to produce this HTML code so I'm using my own
but it's boring to move same function from one plugin to another.
My notice helper code:
{{{
function html_notice_helper($message, $type = 'updated', $echo = true)
{
$text = '<div class="' . $type . ' fade"><p>' . $message .
'</p></div>';
if($echo) echo $text;
return $text;
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12738>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list