Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Hide notices on woo-dash pages #36

Merged
merged 1 commit into from
May 11, 2018
Merged

Hide notices on woo-dash pages #36

merged 1 commit into from
May 11, 2018

Conversation

justinshreve
Copy link
Collaborator

This PR hides standard WP admin notices (admin_notices) on woo-dash pages. This is only a partial solution. See #35, which still needs fully addressed once we have a design for how we actually want to present these.

This uses the solution Kevin came up with for synchrotron and WordPress/gutenberg#5590, however it also includes the wp-header-end div so all notices are caught (otherwise, some show up under the nearest h1/h2 🤦‍♂️ ).

To Test:

  • Add a plugin that shows a notice. If you need one, you can use the following as a plugin:
<?php
/*
Plugin Name: Add Test Notice
Description: Adds a test notice.
Author: WooCommerce
Version: 1.0
*/

function test_add_notice() { ?>
	<div class="notice notice-warning is-dismissible">
		<p>
			<strong>Testing notice.</strong>
		</p>
	</div>
<?php }

add_action( 'admin_notices', 'test_add_notice' );

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing out well for me. Thanks for getting this one in early Justin!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants