';
break;
default:
$message = __( 'There\'s something wrong with your code...', 'gsconnector' );
$admin_notice = "
\n";
break;
}
$admin_notice .= "
" . $message . "
\n";
$admin_notice .= "
\n";
return $admin_notice;
}
/**
* Utility function to get the current user's role
*
* @since 1.0
*/
public function get_current_user_role() {
global $wp_roles;
foreach ( $wp_roles->role_names as $role => $name ) :
if ( current_user_can( $role ) )
return $role;
endforeach;
}
/**
* Utility function to get the current user's role
*
* @since 1.0
*/
public static function gs_debug_log($error){
try{
if( ! is_dir( GS_CONNECTOR_PATH.'logs' ) ){
mkdir( GS_CONNECTOR_PATH . 'logs', 0755, true );
}
} catch (Exception $e) {
}
try{
$log = fopen( GS_CONNECTOR_PATH . "logs/log.txt", 'a');
if ( is_array( $error ) ) {
fwrite($log, print_r(date_i18n( 'j F Y H:i:s', current_time( 'timestamp' ) )." \t PHP ".phpversion(), TRUE));
fwrite( $log, print_r($error, TRUE));
} else {
$result = fwrite($log, print_r(date_i18n( 'j F Y H:i:s', current_time( 'timestamp' ) )." \t PHP ".phpversion()." \t $error \r\n", TRUE));
}
fclose( $log );
} catch (Exception $e) {
}
}
}