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

Hide notices on woo-dash pages - #36

Merged
emdashcodes merged 1 commit into
masterfrom
hide-notices
May 11, 2018
Merged

emdashcodes merged 1 commit into
masterfrom
hide-notices

Conversation

@emdashcodes

Copy link
Copy Markdown
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' );

@timmyc timmyc left a comment

Copy link
Copy Markdown
Contributor

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!

@emdashcodes
emdashcodes merged commit a3a48e3 into master May 11, 2018
@emdashcodes
emdashcodes deleted the hide-notices branch May 11, 2018 17:07
@timmyc timmyc mentioned this pull request May 11, 2018
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