Skip to content

Instantly share code, notes, and snippets.

@arelthia
Last active December 16, 2015 00:49
Show Gist options
  • Save arelthia/5350925 to your computer and use it in GitHub Desktop.
Save arelthia/5350925 to your computer and use it in GitHub Desktop.
Display Log Notices
*
* Display the admin notices
* Based off of ???
*/
function pt_import_notices() {
global $gpt_log;
if (!empty($gpt_log)) {
?>
<div class="wrap">
<?php if (!empty($gpt_log['error'])): ?>
<div class="error">
<?php //display all error messages ?>
<?php foreach ($gpt_log['error'] as $error): ?>
<p><?php echo $error; ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if (!empty($gpt_log['notice'])): ?>
<div class="updated fade">
<?php //display all notices ?>
<?php foreach ($gpt_log['notice'] as $notice): ?>
<p><?php echo $notice; ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div><!-- end wrap -->
<?php
$gpt_log = array();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment