settings = SettingsManager::get_instance(); $this->init_hooks(); } private function init_hooks() { if ($this->get_setting('enable_login_customizer')) { add_action('login_enqueue_scripts', [$this, 'login_styles']); add_filter('login_headerurl', [$this, 'login_header_url']); add_filter('login_headertext', [$this, 'login_header_title']); } } private function get_setting($key, $default = '') { return $this->settings->get('login_styler', $key, $default); } public function login_styles() { $logo_url = $this->get_setting('logo_url'); $bg_color = $this->get_setting('bg_color', '#f1f1f1'); $bg_image = $this->get_setting('bg_image'); $form_bg_color = $this->get_setting('form_bg_color', '#ffffff'); echo ''; } public function login_header_url() { $url = $this->get_setting('logo_link_url'); return $url ? $url : home_url(); } public function login_header_title() { return $this->get_setting('logo_title', get_bloginfo('name')); } public function render_settings() { $settings = [ 'enable_login_customizer' => ['type' => 'checkbox', 'label' => __('Enable Login Customizer', 'admin-menu-optimizer')], 'logo_url' => ['type' => 'text', 'label' => __('Logo URL', 'admin-menu-optimizer')], 'logo_link_url' => ['type' => 'text', 'label' => __('Logo Link URL', 'admin-menu-optimizer')], 'logo_title' => ['type' => 'text', 'label' => __('Logo Title', 'admin-menu-optimizer')], 'bg_color' => ['type' => 'color', 'label' => __('Background Color', 'admin-menu-optimizer')], 'bg_image' => ['type' => 'text', 'label' => __('Background Image URL', 'admin-menu-optimizer')], 'form_bg_color' => ['type' => 'color', 'label' => __('Form Background Color', 'admin-menu-optimizer')], 'custom_css' => ['type' => 'textarea', 'label' => __('Custom CSS', 'admin-menu-optimizer')], ]; echo ''; foreach ($settings as $key => $field) { $value = $this->get_setting($key); echo ''; echo ''; echo ''; echo ''; } echo ''; } }