This commit is contained in:
Mykyta Synelnikov
2024-11-13 16:42:26 +02:00
parent 2679f4744b
commit 48371d1d06
3 changed files with 48 additions and 41 deletions
+12 -8
View File
@@ -42,14 +42,7 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
*/
public function __construct() {
if ( ! $this->can_be_active() ) {
UM()->admin()->notices()->add_notice(
'um-action-scheduler',
array(
'class' => 'notice-warning is-dismissible',
// translators: %1$s - Plugin name, %1$s - Plugin Version
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>',
)
);
add_action( 'init', array( $this, 'add_notice' ) );
} else {
add_filter( 'um_settings_structure', array( $this, 'add_setting' ) );
@@ -60,6 +53,17 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
}
}
public function add_notice() {
UM()->admin()->notices()->add_notice(
'um-action-scheduler',
array(
'class' => 'notice-warning is-dismissible',
// translators: %1$s - Plugin name, %1$s - Plugin Version
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>',
)
);
}
/**
* Adds the Action Scheduler setting to Ultimate Member feature settings
*