Skip to content

Commit

Permalink
Don't hide admin notices of WP Crontrol plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbills committed Jan 21, 2024
1 parent b2da192 commit b4c3f58
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
= 2.3.4 - 2024-01-21 =

- Don't hide admin notices of WP Crontrol plugin.

= 2.3.3 - 2024-01-12 =

- More fixes related to admin notices. Sorry.
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions includes/tweaks/hide-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function wp_tweaks_hide_admin_notices () {
display: none;
}

/* allowlist */
#wpwrap .wrap .updated,
#wpwrap .wrap .notice.update-message,
#wpwrap .wrap .notice[id="message"],
Expand All @@ -48,3 +49,20 @@ function wp_tweaks_hide_admin_notices () {
ob_get_clean()
);
}

// don't hide WP Crontrol notices
add_filter( 'wp_tweaks_hide_admin_notices_css_rules', function ( $css ) {
if ( defined( "Crontrol\\WP_CRONTROL_VERSION" ) ) {
$custom_css = "
#wpwrap .wrap .notice#crontrol-late-message,
#wpwrap .wrap .notice#crontrol-status-notice,
#wpwrap .wrap .notice#crontrol-status-error,
#wpwrap .wrap .notice#crontrol-timezon-warning,
#wpwrap .wrap .notice#crontrol-event-not-found,
#wpwrap .wrap .notice#crontrol-message,
";
$find = '/* allowlist */';
$css = str_replace( $find, "{$find}{$custom_css}", $css );
}
return $css;
} );
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Donate link: https://www.luizpb.com/donate/
Requires at least: 4.0
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 2.3.3
Stable tag: 2.3.4
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -55,6 +55,10 @@ Support this plugin on [https://luizpb.com/donate/](https://luizpb.com/donate/)

== Changelog ==

= 2.3.4 - 2024-01-21 =

- Don't hide admin notices of WP Crontrol plugin.

= 2.3.3 - 2024-01-12 =

- More fixes related to admin notices. Sorry.
Expand Down
2 changes: 1 addition & 1 deletion wp-tweaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Tweaks
* Plugin URI: https://github.com/luizbills/wp-tweaks
* Description: Several opinionated WordPress tweaks focused in security and performance.
* Version: 2.3.3
* Version: 2.3.4
* Requires at least: 4.0
* Requires PHP: 7.4
* Author: Luiz Bills
Expand Down

0 comments on commit b4c3f58

Please sign in to comment.