Skip to content

Commit

Permalink
Janitorial: use wp_admin_notice function introduced in WP 6.4 (#37051)
Browse files Browse the repository at this point in the history
* Janitorial: use wp_admin_notice function introduced in WP 6.4

Epic: #33615

* Handle possibility of no message

* Switch from string to array

* Add missing escaping

* Fix indenting

* Add missing escaping

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8833248507

Upstream-Ref: Automattic/jetpack@993a91b
  • Loading branch information
jeherve authored and matticbot committed Apr 25, 2024
1 parent a9eddcc commit fb54c66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This is an alpha version! The changes listed here are not final.

### Changed
- General: update WordPress version requirements to WordPress 6.4.
- General: use wp_admin_notice function introduced in WP 6.4 to display notices.
- Updated package dependencies.

### Fixed
Expand Down
7 changes: 6 additions & 1 deletion partials/preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

echo '<a name="preload"></a>';
if ( ! $cache_enabled || ! $super_cache_enabled || true === defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
echo '<div class="notice notice-warning"><p>' . __( 'Preloading of cache disabled. Please make sure simple or expert mode is enabled or talk to your host administrator.', 'wp-super-cache' ) . '</p></div>';
wp_admin_notice(
esc_html__( 'Preloading of cache disabled. Please make sure simple or expert mode is enabled or talk to your host administrator.', 'wp-super-cache' ),
array(
'type' => 'warning',
)
);
return;
}

Expand Down

0 comments on commit fb54c66

Please sign in to comment.