Skip to content

Instantly share code, notes, and snippets.

@CatEntangler
Created February 26, 2018 03:08
Show Gist options
  • Save CatEntangler/d813ba89bd730653de77b4a8adb38e8d to your computer and use it in GitHub Desktop.
Save CatEntangler/d813ba89bd730653de77b4a8adb38e8d to your computer and use it in GitHub Desktop.
WordPress dashboard front-end logging
/*
* This usually goes in an mu-plugins file but for now here it is on its own
* This will pretty print anything to the screen (so you can safely have WP_DEBUG_DISPLAY FALSE
* The styles are specific to the default dashboard layouts
*/
if( ! function_exists( '_frontlog' ) ) {
function _frontlog( $message ) {
echo "<pre style='background-color:white;margin-left:159px;border:1px solid black;padding:15px;'>";
print_r( $message );
echo "</pre>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment