admin_url('admin-ajax.php'), 'nonce' => esc_attr(wp_create_nonce('access_control_security_nonce')), ); wp_localize_script('pl-access-control-public-script', 'access_control_ajax_obj', $access_control_ajax_params); $pl_access_control_colors = get_option('pl_access_control_colors', [ 'barBackground' => '#5007AA', 'barText' => '#FFFFFF', 'button' => '#D1C1FF', 'buttonText' => '#000000', ]); // Sanitize colors properly $bar_bg = sanitize_hex_color($pl_access_control_colors['barBackground']); $bar_text = sanitize_hex_color($pl_access_control_colors['barText']); $btn_bg = sanitize_hex_color($pl_access_control_colors['button']); $btn_text = sanitize_hex_color($pl_access_control_colors['buttonText']); $dynamic_css = " #access_control_switch_on { background-color: {$bar_bg} !important; color: {$bar_text} !important; } #access_control_switch_on .switch-to-another .header-text, #access_control_switch_on .switch-to-old a, #access_control_switch_on .current-user-data::before, #access_control_switch_on .switch-to-another .hover-content .ab-item form.search-user .search-user-btn, #access_control_switch_on .switch-to-another .hover-content ul li a:hover { background-color: {$btn_bg} !important; border-color: {$btn_bg} !important; color: {$btn_text} !important; } "; wp_add_inline_style('pl-access-control-public-style', $dynamic_css); } } new Pl_Access_Control_Hooks();