Skip to content

Instantly share code, notes, and snippets.

@1bigidea
Created July 6, 2016 21:27
Show Gist options
  • Save 1bigidea/689240d194161298333fa41d20da9eb1 to your computer and use it in GitHub Desktop.
Save 1bigidea/689240d194161298333fa41d20da9eb1 to your computer and use it in GitHub Desktop.
if( !function_exists('kickout') ){
function kickout(){
$args = func_get_args();
$file_output = array_shift($args);
$file_append = false;
// prepare the output
$output = '';
for($i=0;$i<count($args);$i++){
if( is_object($args[$i]) || is_array($args[$i]) ){
$output .= print_r($args[$i], true)."\n";
} elseif( $args[$i] == FILE_APPEND ) {
$file_append = true;
} else {
$output .= "\n".$args[$i]."\n";
}
}
file_put_contents(WP_CONTENT_DIR.'/_'.$file_output.'.txt', $output, ($file_append) ? FILE_APPEND : null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment