From 73e70ab90c766e908f677b736622f8cb33f3523b Mon Sep 17 00:00:00 2001 From: Grzegorz Rola <grola@seostudio.pl> Date: Thu, 12 Aug 2021 14:23:54 +0200 Subject: [PATCH] feature(generator): generate reminder only when configuration present --- src/Reminder.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Reminder.php b/src/Reminder.php index a3eda41..bf28dd1 100644 --- a/src/Reminder.php +++ b/src/Reminder.php @@ -7,10 +7,8 @@ class Reminder { private $logo_url = 'logo-url'; public function __construct() { - if ( function_exists( 'add_action' ) ) { - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_reminder_script' ) ); - add_action( 'admin_footer', array( $this, 'display_html_element' ) ); - } + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_reminder_script' ) ); + add_action( 'admin_footer', array( $this, 'display_html_element' ) ); } public function enqueue_reminder_script() { @@ -48,4 +46,6 @@ class Reminder { } -new Reminder(); +if ( function_exists( 'add_action' ) ) { + new Reminder(); +} -- GitLab