' . $message . '
' );
exit;
default:
if ( !defined( 'WP_DEBUG' ) || WP_DEBUG != true || !defined( 'WP_FFPC__DEBUG_MODE' ) || WP_FFPC__DEBUG_MODE != true )
return;
break;
}
error_log( __CLASS__ . ": " . $message );
}
/**
* display formatted alert message
*
* @param string $msg Error message
* @param string $error "level" of error
* @param boolean $network WordPress network or not, DEPRECATED
*
*/
static public function alert ( $msg, $level=LOG_WARNING, $network=false ) {
if ( empty($msg)) return false;
switch ($level) {
case LOG_ERR:
case LOG_WARNING:
$css = "error";
break;
default:
$css = "updated";
break;
}
$r = ''. sprintf ( __('%s', 'PluginUtils' ), $msg ) .'
';
if ( version_compare(phpversion(), '5.3.0', '>=')) {
add_action('admin_notices', function() use ($r) { echo $r; }, 10 );
}
else {
global $tmp;
$tmp = $r;
$f = create_function ( '', 'global $tmp; echo $tmp;' );
add_action('admin_notices', $f );
}
static::debug( $msg, $level );
}
}
endif;