Skip to content

Instantly share code, notes, and snippets.

@tokkonopapa
Last active December 27, 2016 15:16
Show Gist options
  • Save tokkonopapa/e72987dcb1dc81df97476a976f32f6b8 to your computer and use it in GitHub Desktop.
Save tokkonopapa/e72987dcb1dc81df97476a976f32f6b8 to your computer and use it in GitHub Desktop.
IP Geo Block SQL Error handling
/**
* SQL Error handling
*
*/
private static function error( $line ) {
if ( class_exists( 'IP_Geo_Block_Admin' ) ) {
global $wpdb;
if ( $wpdb->last_error )
IP_Geo_Block_Admin::add_admin_notice( 'error', __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
}
if ( defined( 'WP_DEBUG' ) && WP_DEBUG )
error_log( __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment