Skip to content

Commit

Permalink
Fixed notices
Browse files Browse the repository at this point in the history
  • Loading branch information
jcssamoylov committed Jul 22, 2015
1 parent 7197fe9 commit f7b03cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion just-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,15 @@ function jcf_update_options($key, $value){
* @param array $args Array with messages
*/
function jcf_admin_notice($args = array()){
remove_action( 'admin_notices', 'update_nag', 3 );
global $wp_version;
if(!empty($args))
{
foreach($args as $key => $value)
{
echo '<div id="message" class="updated notice ' . ($key == 'error' ? $key . ' is-dismissible' : 'is-dismissible') . ' below-h2 "><p>' . __($value, JCF_TEXTDOMAIN) . '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', JCF_TEXTDOMAIN) . '</span></button></div>';
echo '<div class="updated notice ' . ($key == 'error' ? $key . ' is-dismissible' : 'is-dismissible') . ' below-h2 "><p>' . __($value, JCF_TEXTDOMAIN) . '</p>
' . ($wp_version < 4.2 ? '' : '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', JCF_TEXTDOMAIN) . '</span></button>') . '
</div>';
}
}
}
Expand Down

0 comments on commit f7b03cf

Please # to comment.