Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Created October 3, 2023 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronjonesweb/c69ae4749f0c7f1ca5b6299ef16168b6 to your computer and use it in GitHub Desktop.
Save cameronjonesweb/c69ae4749f0c7f1ca5b6299ef16168b6 to your computer and use it in GitHub Desktop.
Wipe the WordPress admin dashboard and replace with your own custom template
<?php
add_action(
'all_admin_notices',
function() {
$screen = get_current_screen();
if ( 'dashboard' === $screen->base ) {
/* Your code goes here */
ob_start();
}
},
99999
);
add_action(
'in_admin_footer',
function() {
$screen = get_current_screen();
if ( 'dashboard' === $screen->base ) {
ob_end_clean();
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment