Skip to content

Commit

Permalink
Confirmed WordPress 6.3 compliance.
Browse files Browse the repository at this point in the history
  • Loading branch information
KZeni committed Jul 24, 2023
1 parent f46fd30 commit 9cf7427
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 261 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.nova
config.codekit
config.codekit3
.nova
config.codekit
config.codekit3
prepros.config
8 changes: 4 additions & 4 deletions admin-bar-wrap-fix.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions admin-bar-wrap-fix.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions admin-bar-wrap-fix.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?php
/*
* Plugin name: Admin Bar Wrap Fix
* Plugin URI: https://wordpress.org/plugins/admin-bar-wrap-fix/
* Description: Fixes the wrap behavior of the WordPress admin bar when it has too many items. Keep it neat; don't spill/overflow into the content.
* Author: KZeni
* Author URI: https://kzeni.com
* License: GPLv3
* Version: 1.2.4
* Requires at least: 4.6
* Tested up to: 6.1
*/

define('ADMIN_BAR_WRAP_FIX_PLUGIN_VERSION', '1.2.4');
define('ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE', __FILE__);
define('ADMIN_BAR_WRAP_FIX_PLUGIN_DIR_PATH', plugin_dir_path(ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE));
define('ADMIN_BAR_WRAP_FIX_PLUGIN_DIR_URL', plugin_dir_url(ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE));

function add_wp_adminbar_wrap_fix_css()
{
if (is_admin_bar_showing()) {
// Only bother to include stylesheet when the admin bar is being shown
wp_register_style('admin-bar-wrap-fix', plugins_url('/admin-bar-wrap-fix.css', __FILE__), [], ADMIN_BAR_WRAP_FIX_PLUGIN_VERSION, 'screen');
wp_enqueue_style('admin-bar-wrap-fix');
}
}
add_action('wp_enqueue_scripts', 'add_wp_adminbar_wrap_fix_css');
add_action('admin_enqueue_scripts', 'add_wp_adminbar_wrap_fix_css');
<?php
/*
* Plugin name: Admin Bar Wrap Fix
* Plugin URI: https://wordpress.org/plugins/admin-bar-wrap-fix/
* Description: Fixes the wrap behavior of the WordPress admin bar when it has too many items. Keep it neat; don't spill/overflow into the content.
* Author: KZeni
* Author URI: https://kzeni.com
* License: GPLv3
* Version: 1.2.6
* Requires at least: 4.6
* Tested up to: 6.3
*/

define('ADMIN_BAR_WRAP_FIX_PLUGIN_VERSION', '1.2.6');
define('ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE', __FILE__);
define('ADMIN_BAR_WRAP_FIX_PLUGIN_DIR_PATH', plugin_dir_path(ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE));
define('ADMIN_BAR_WRAP_FIX_PLUGIN_DIR_URL', plugin_dir_url(ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE));

function add_wp_adminbar_wrap_fix_css()
{
if (is_admin_bar_showing()) {
// Only bother to include stylesheet when the admin bar is being shown
wp_register_style('admin-bar-wrap-fix', plugins_url('/admin-bar-wrap-fix.css', __FILE__), [], ADMIN_BAR_WRAP_FIX_PLUGIN_VERSION, 'screen');
wp_enqueue_style('admin-bar-wrap-fix');
}
}
add_action('wp_enqueue_scripts', 'add_wp_adminbar_wrap_fix_css');
add_action('admin_enqueue_scripts', 'add_wp_adminbar_wrap_fix_css');
116 changes: 58 additions & 58 deletions admin-bar-wrap-fix.scss
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
@media screen and (min-width: 782px) {
// Prevent wrapping of admin bar that has more items than admin bar area on desktop/tablet layout
#wpadminbar {
.quicklinks {
justify-content: space-between;
> ul > li {
float: none !important;
}
> ul > li,
.ab-item {
white-space: nowrap;
text-overflow: ellipsis;
min-width: 0 !important;
}
.ab-item {
overflow: hidden;
.ab-label,
.display-name {
float: none;
display: inline;
}
}
}
.quicklinks,
.quicklinks > ul {
display: -ms-flexbox;
display: flex;
flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
min-width: 0 !important;
}
#wp-admin-bar-top-secondary {
flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
}
}
}
@media screen and (max-width: 782px) {
// Prevent wrapping of admin bar that has more items than admin bar area on mobile layout
#wpcontent {
padding-top: 15px; // Browser scrollbar dimension per https://codepen.io/sambible/post/browser-scrollbar-widths(with the overflow-y:hidden; handling the difference between them)
}
#wpadminbar {
display: flex;
flex-wrap: nowrap;
padding-bottom: 15px; // Browser scrollbar dimension per https://codepen.io/sambible/post/browser-scrollbar-widths (with the overflow-y:hidden; handling the difference between them)
overflow-x: scroll;
overflow-y: hidden;
> *,
.ab-top-menu {
display: flex;
flex-wrap: nowrap;
}
.ab-sub-wrapper {
display: none !important;
}
}
}
@media screen and (min-width: 782px) {
// Prevent wrapping of admin bar that has more items than admin bar area on desktop/tablet layout
#wpadminbar {
.quicklinks {
justify-content: space-between;
> ul > li {
float: none !important;
}
> ul > li,
.ab-item {
white-space: nowrap;
text-overflow: ellipsis;
min-width: 0 !important;
}
.ab-item {
overflow: hidden;
.ab-label,
.display-name {
float: none;
display: inline;
}
}
}
.quicklinks,
.quicklinks > ul {
display: -ms-flexbox;
display: flex;
flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
min-width: 0 !important;
}
#wp-admin-bar-top-secondary {
flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
}
}
}
@media screen and (max-width: 782px) {
// Prevent wrapping of admin bar that has more items than admin bar area on mobile layout
#wpcontent {
padding-top: 15px; // Browser scrollbar dimension per https://codepen.io/sambible/post/browser-scrollbar-widths(with the overflow-y:hidden; handling the difference between them)
}
#wpadminbar {
display: flex;
flex-wrap: nowrap;
padding-bottom: 15px; // Browser scrollbar dimension per https://codepen.io/sambible/post/browser-scrollbar-widths (with the overflow-y:hidden; handling the difference between them)
overflow-x: scroll;
overflow-y: hidden;
> *,
.ab-top-menu {
display: flex;
flex-wrap: nowrap;
}
.ab-sub-wrapper {
display: none !important;
}
}
}
Loading

0 comments on commit 9cf7427

Please sign in to comment.