Add new function to remove unwanted notices and remove Hello Dolly
This commit is contained in:
parent
039ca2a1a9
commit
1ae9ffc188
|
@ -277,6 +277,21 @@ function wc_admin_admin_body_class( $admin_body_class = '' ) {
|
|||
}
|
||||
add_filter( 'admin_body_class', 'wc_admin_admin_body_class' );
|
||||
|
||||
/**
|
||||
* Removes notices that should not be displayed on WC Admin pages.
|
||||
*/
|
||||
function wc_admin_remove_notices() {
|
||||
if ( ! wc_admin_is_admin_page() && ! wc_admin_is_embed_enabled_wc_page() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Hello Dolly.
|
||||
if ( function_exists( 'hello_dolly' ) ) {
|
||||
remove_action( 'admin_notices', 'hello_dolly' );
|
||||
}
|
||||
}
|
||||
add_action( 'admin_head', 'wc_admin_remove_notices' );
|
||||
|
||||
/**
|
||||
* Runs before admin notices action and hides them.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue