From 2ef9d7d40bf4fe45dd9a385f5b6c97186256f2f7 Mon Sep 17 00:00:00 2001 From: Guy Primavera Date: Mon, 31 May 2021 16:24:00 +0200 Subject: [PATCH] Minor bugfixes --- admin/options.php | 334 +--------------------------------- admin/options/helpers.php | 13 +- aquila-admin-theme.php | 2 +- css/adminBar.css | 16 +- css/adminBar.less | 15 +- login/aquila-login-screen.php | 39 ++-- readme.txt | 6 +- scripts.php | 4 +- 8 files changed, 62 insertions(+), 367 deletions(-) diff --git a/admin/options.php b/admin/options.php index 6c94839..454e5a4 100644 --- a/admin/options.php +++ b/admin/options.php @@ -1,333 +1 @@ - ' . __('Aquila', 'aquila-admin-theme'), - 'manage_options', - 'aquilaSettings', - 'aquila_options_page' - ); -} - -function aquila_settings_init() { - register_setting('aquilaGeneralSettings', 'aquila_settings'); - - add_settings_section( - 'aquila_aquilaGeneralSettings_section', - __('Aquila Settings', 'aquila-admin-theme'), - 'aquilaGeneralCallback', - 'aquilaGeneralSettings' - ); - - add_settings_field( - 'aquila_chk_abLinks', - __('Show Adminbar links?', 'aquila-admin-theme'), - 'aquila_chk_abLinks_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - add_settings_field( - 'aquila_chk_pluginSupport', - __('Show Editors Plugins Support metabox?', 'aquila-admin-theme'), - 'aquila_chk_pluginSupport_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - add_settings_field( - 'aquila_chk_dashBoxes', - __('Show all other Dashboard metaboxes?', 'aquila-admin-theme'), - 'aquila_chk_dashBoxes_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - add_settings_field( - 'aquila_chk_postBlog', - __('Do not rename Posts to Blog', 'aquila-admin-theme'), - 'aquila_chk_postBlog_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - add_settings_field( - 'aquila_chk_hideFooter', - __('Hide Footer credit link.', 'aquila-admin-theme'), - 'aquila_chk_hideFooter_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - add_settings_field( - 'aquila_chk_showNag', - __('Show WordPress Update notices.', 'aquila-admin-theme'), - 'aquila_chk_showNag_render', - 'aquilaGeneralSettings', - 'aquila_aquilaGeneralSettings_section' - ); - - // Custom Logo - register_setting('aquilaLogoSettings', 'aquilaLogoSettings'); - - add_settings_section( - 'aquila_aquilaLogoSettings_section', - __('Custom Logo', 'aquila-admin-theme'), - 'aquilaLogoCallback', - 'aquilaLogoSettings' - ); - - add_settings_field( - 'aquila_new_logo', - __('Custom logo', 'aquila-admin-theme'), - 'aquila_new_logo_render', - 'aquilaLogoSettings', - 'aquila_aquilaLogoSettings_section' - ); - - add_settings_field( - 'aquila_new_logo_sqr', - __('Custom logo (square)
Used in the "folded" menu', 'aquila-admin-theme'), - 'aquila_new_logo_sqr_render', - 'aquilaLogoSettings', - 'aquila_aquilaLogoSettings_section' - ); - - - // Colour Scheme - register_setting('aquilaColourSettings', 'aquilaColourSettings'); - - add_settings_section( - 'aquila_aquilaColourSettings_section', - __('Color Scheme', 'aquila-admin-theme'), - 'aquilaColourCallback', - 'aquilaColourSettings' - ); - - add_settings_field( - 'aquila_primary_colour', - __('Primary Color', 'aquila-admin-theme'), - 'aquila_primary_colour_render', - 'aquilaColourSettings', - 'aquila_aquilaColourSettings_section' - ); - - add_settings_field( - 'aquila_secondary_colour', - __('Secondary Color', 'aquila-admin-theme'), - 'aquila_secondary_colour_render', - 'aquilaColourSettings', - 'aquila_aquilaColourSettings_section' - ); - - add_settings_field( - 'aquila_menu_back_colour', - __('Menu Background Color', 'aquila-admin-theme'), - 'aquila_menu_back_colour_render', - 'aquilaColourSettings', - 'aquila_aquilaColourSettings_section' - ); -} - -function aquila_chk_abLinks_render() { - $options = get_option('aquila_settings'); - if (isset($options['aquila_chk_abLinks'])) { - $aquilaABLinks = $options['aquila_chk_abLinks']; - } else { - $aquilaABLinks = 0; - }; - ?> - value='1'> - - value='1'> - - value='1'> - - value='1'> - - value='1'> - - value='1'> - - - - - - - - - - - - - - - - - - - - - - -
- -

- - - - - -
- - - -
-
- - - '. __( 'Upload logo', 'aquila-admin-theme' ) .' - '. __( 'Remove logo', 'aquila-admin-theme' ) .' - '; + '. __( 'Upload logo', 'aquila-admin-theme' ) .''; + + if (!!$options && !!$imgSrc) { + echo ''. __( 'Remove logo', 'aquila-admin-theme' ) .''; + } + echo ''; echo wp_get_attachment_url(get_option('media_selector_attachment_id')); } diff --git a/aquila-admin-theme.php b/aquila-admin-theme.php index 7e90ff5..ea5d93c 100644 --- a/aquila-admin-theme.php +++ b/aquila-admin-theme.php @@ -5,7 +5,7 @@ * Description: The Aquila Admin Theme * Author: Guy Primavera * Author URI: https://guyprimavera.com/ - * Version: 3.1 + * Version: 3.1.1 * Text Domain: aquila-admin-theme * Domain Path: /lang/ * License: GPL2 diff --git a/css/adminBar.css b/css/adminBar.css index fc706cf..de60ccf 100644 --- a/css/adminBar.css +++ b/css/adminBar.css @@ -182,6 +182,11 @@ body.admin-bar #wpadminbar .noticon { display: none; padding-left: 0px; } +@media screen and (max-width: 782px) { + .aquilaFront #wpadminbar { + padding-left: 50px; + } +} .aquilaShowBarDefault.aquilaFront #wpadminbar { padding-left: 0px; } @@ -323,8 +328,15 @@ body.admin-bar #wpadminbar .noticon { height: 46px; } } -#wpadminbar #wp-admin-bar-site-name > .ab-item:before { - display: none!important; +@media screen and (max-width: 782px) { + #wpadminbar #wp-admin-bar-site-name > .ab-item { + font-size: 0; + } +} +@media screen and (min-width: 783px) { + #wpadminbar #wp-admin-bar-site-name > .ab-item:before { + display: none!important; + } } #wpadminbar li#wp-admin-bar-wp-logo { margin-right: 20px!important; diff --git a/css/adminBar.less b/css/adminBar.less index 52d69b0..28e350d 100644 --- a/css/adminBar.less +++ b/css/adminBar.less @@ -33,6 +33,10 @@ body.admin-bar { display: none; padding-left: 0px; + @media screen and (max-width: 782px) { + padding-left: 50px; + } + .aquilaShowBarDefault& { padding-left: 0px; } @@ -192,8 +196,15 @@ body.admin-bar { #wp-admin-bar-site-name>.ab-item { - &:before { - .dNI; + @media screen and (max-width: 782px) { + font-size: 0; + } + + @media screen and (min-width: 783px) { + + &:before { + .dNI; + } } } diff --git a/login/aquila-login-screen.php b/login/aquila-login-screen.php index 2f70a4b..325222c 100644 --- a/login/aquila-login-screen.php +++ b/login/aquila-login-screen.php @@ -1,6 +1,6 @@ - body.login #login:before { - display: none!important; - } - body.login #login h1 a { - display: block!important; - } - body.login #login h1 a { - background-image: url('" . $GLOBALS['aquilaNewLogo'] . "')!important; - background-size: contain; - background-repeat: no-repeat; - background-position: center center; - width: auto; - height: 80px; - max-width: 350px; - } - "; + $options = get_option('aquilaLogoSettings'); + if (!empty($options) && isset($GLOBALS['aquilaNewLogo'])) { + echo ""; + } } diff --git a/readme.txt b/readme.txt index 87a7a4d..b92b6c9 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: admin theme, material design wordpress, material design admin theme, material design wordpress admin, material wordpress, admin, admin panel, admin theme style plugin, admin-theme, admin theme, aquila, backend theme, clean admin, color scheme, colour scheme, custom admin theme, flat admin theme, free admin theme, modern admin theme, new admin ui, plugin, simple admin theme, white label, white label admin, wordpress, WordPress admin, wordpress admin theme, wp-admin, wp admin page, wp admin theme Requires at least: 4.0 Tested up to: 5.7 -Stable tag: 3.1 +Stable tag: 3.1.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -83,7 +83,7 @@ No. It only changes the admin area, the login page and the admin bar for logged- == Changelog == -= 3.1 - 31/05/2021 = += 3.1.1 - 31/05/2021 = * Code refactored. * Bug fixes. * New support links for adminbar. @@ -225,7 +225,7 @@ No. It only changes the admin area, the login page and the admin bar for logged- == Upgrade Notice == -= 3.1 = += 3.1.1 = * Code refactored. * Bug fixes. * New support links for adminbar. diff --git a/scripts.php b/scripts.php index e13929e..3dd8855 100644 --- a/scripts.php +++ b/scripts.php @@ -16,7 +16,7 @@ function aquila_global_load_style() { } add_action('admin_enqueue_scripts', 'aquila_global_load_style'); add_action('wp_head', 'aquila_global_load_style', 99); -if (!$GLOBALS['aquilaLoginDisable']) { +if (empty($GLOBALS['aquilaLoginDisable']) || !$GLOBALS['aquilaLoginDisable']) { add_action('login_enqueue_scripts', 'aquila_global_load_style'); } @@ -45,7 +45,7 @@ function aquila_login_load_style() { wp_enqueue_style('aquila-login-style'); } -if (!$GLOBALS['aquilaLoginDisable']) { +if (empty($GLOBALS['aquilaLoginDisable']) || !$GLOBALS['aquilaLoginDisable']) { add_action('login_enqueue_scripts', 'aquila_login_load_style'); }