diff --git a/action-scheduler.php b/action-scheduler.php
index 1727f2823..4cc18287e 100644
--- a/action-scheduler.php
+++ b/action-scheduler.php
@@ -7,7 +7,7 @@
* Author URI: https://automattic.com/
* Version: 3.8.0
* License: GPLv3
- * Requires at least: 6.2
+ * Requires at least: 6.4
* Tested up to: 6.5
* Requires PHP: 5.6
*
diff --git a/classes/ActionScheduler_AdminView.php b/classes/ActionScheduler_AdminView.php
index ed30950a7..154d93ea0 100644
--- a/classes/ActionScheduler_AdminView.php
+++ b/classes/ActionScheduler_AdminView.php
@@ -190,8 +190,7 @@ protected function check_pastdue_actions() {
), admin_url( 'tools.php' ) );
# Print notice.
- echo '
';
- printf(
+ $message = sprintf(
// translators: 1) is the number of affected actions, 2) is a link to an admin screen.
_n(
'Action Scheduler: %1$d past-due action found; something may be wrong. Read documentation »',
@@ -202,7 +201,13 @@ protected function check_pastdue_actions() {
$num_pastdue_actions,
esc_attr( esc_url( $actions_url ) )
);
- echo '
';
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'warning',
+ 'paragraph_wrap' => true,
+ )
+ );
# Facilitate third-parties to evaluate and print notices.
do_action( 'action_scheduler_pastdue_actions_extra_notices', $query_args );
diff --git a/classes/ActionScheduler_ListTable.php b/classes/ActionScheduler_ListTable.php
index abf767ce6..5e5fba727 100644
--- a/classes/ActionScheduler_ListTable.php
+++ b/classes/ActionScheduler_ListTable.php
@@ -360,7 +360,7 @@ public function display_admin_notices() {
foreach ( $table_list as $table_name ) {
if ( ! in_array( $wpdb->prefix . $table_name, $found_tables ) ) {
$this->admin_notices[] = array(
- 'class' => 'error',
+ 'type' => 'error',
'message' => __( 'It appears one or more database tables were missing. Attempting to re-create the missing table(s).' , 'action-scheduler' ),
);
$this->recreate_tables();
@@ -374,7 +374,7 @@ public function display_admin_notices() {
if ( $this->runner->has_maximum_concurrent_batches() ) {
$claim_count = $this->store->get_claim_count();
$this->admin_notices[] = array(
- 'class' => 'updated',
+ 'type' => 'updated',
'message' => sprintf(
/* translators: %s: amount of claims */
_n(
@@ -401,7 +401,7 @@ public function display_admin_notices() {
}
$this->admin_notices[] = array(
- 'class' => 'notice notice-info',
+ 'type' => 'info',
'message' => $async_request_message,
);
}
@@ -414,7 +414,7 @@ public function display_admin_notices() {
$action = $this->store->fetch_action( $notification['action_id'] );
$action_hook_html = '' . $action->get_hook() . '';
if ( 1 == $notification['success'] ) {
- $class = 'updated';
+ $type = 'updated';
switch ( $notification['row_action_type'] ) {
case 'run' :
/* translators: %s: action HTML */
@@ -430,7 +430,7 @@ public function display_admin_notices() {
break;
}
} else {
- $class = 'error';
+ $type = 'error';
/* translators: 1: action HTML 2: action ID 3: error message */
$action_message_html = sprintf( __( 'Could not process change for action: "%1$s" (ID: %2$d). Error: %3$s', 'action-scheduler' ), $action_hook_html, esc_html( $notification['action_id'] ), esc_html( $notification['error_message'] ) );
}
@@ -438,7 +438,7 @@ public function display_admin_notices() {
$action_message_html = apply_filters( 'action_scheduler_admin_notice_html', $action_message_html, $action, $notification );
$this->admin_notices[] = array(
- 'class' => $class,
+ 'type' => $type,
'message' => $action_message_html,
);
}
diff --git a/classes/ActionScheduler_WPCommentCleaner.php b/classes/ActionScheduler_WPCommentCleaner.php
index 1ba552c50..1b58be17f 100644
--- a/classes/ActionScheduler_WPCommentCleaner.php
+++ b/classes/ActionScheduler_WPCommentCleaner.php
@@ -90,7 +90,7 @@ public static function delete_all_action_comments() {
public static function register_admin_notice() {
add_action( 'admin_notices', array( __CLASS__, 'print_admin_notice' ) );
}
-
+
/**
* Prints details about the orphaned action logs and includes information on where to learn more.
*/
@@ -110,6 +110,12 @@ public static function print_admin_notice() {
'https://github.com/woocommerce/action-scheduler/issues/368'
);
- echo '' . wp_kses_post( $notice ) . '
';
+ wp_admin_notice(
+ $notice,
+ array(
+ 'type' => 'warning',
+ 'paragraph_wrap' => true,
+ )
+ );
}
}
diff --git a/classes/abstracts/ActionScheduler_Abstract_ListTable.php b/classes/abstracts/ActionScheduler_Abstract_ListTable.php
index 3c480e3da..2c7e51840 100644
--- a/classes/abstracts/ActionScheduler_Abstract_ListTable.php
+++ b/classes/abstracts/ActionScheduler_Abstract_ListTable.php
@@ -103,7 +103,7 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
protected $status_counts = array();
/**
- * Notices to display when loading the table. Array of arrays of form array( 'class' => {updated|error}, 'message' => 'This is the notice text display.' ).
+ * Notices to display when loading the table. Array of arrays of form array( 'type' => {updated|error}, 'message' => 'This is the notice text display.' ).
*
* @var array
*/
@@ -675,9 +675,15 @@ protected function display_header() {
*/
protected function display_admin_notices() {
foreach ( $this->admin_notices as $notice ) {
- echo '';
- echo '
' . wp_kses_post( $notice['message'] ) . '
';
- echo '
';
+ wp_admin_notice(
+ $notice['message'],
+ array(
+ 'id' => 'message',
+ 'type' => $notice['type'] === 'updated' ? '' : $notice['type'],
+ 'paragraph_wrap' => true,
+ 'additional_classes' => ( $notice['type'] === 'updated' ? 'updated' : ''),
+ )
+ );
}
}
diff --git a/classes/migration/Controller.php b/classes/migration/Controller.php
index b2b618d8f..38e03eb7a 100644
--- a/classes/migration/Controller.php
+++ b/classes/migration/Controller.php
@@ -159,7 +159,13 @@ public function hook_admin_notices() {
* Show a dashboard notice that migration is in progress.
*/
public function display_migration_notice() {
- printf( '', esc_html__( 'Action Scheduler migration in progress. The list of scheduled actions may be incomplete.', 'action-scheduler' ) );
+ wp_admin_notice(
+ __('Action Scheduler migration in progress. The list of scheduled actions may be incomplete.', 'action-scheduler' ),
+ array(
+ 'type' => 'warning',
+ 'paragraph_wrap' => true
+ )
+ );
}
/**