Skip to content

Commit

Permalink
Added links to the plugin details on the main plugin page & confirmed…
Browse files Browse the repository at this point in the history
… WordPress 6.4 compliance.
  • Loading branch information
KZeni committed Oct 24, 2023
1 parent 8cf83e3 commit 28cf4cc
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 30 deletions.
103 changes: 75 additions & 28 deletions admin-bar-wrap-fix.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,75 @@
<?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');
<?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.7
* Requires at least: 4.6
* Tested up to: 6.4
*/

define("ADMIN_BAR_WRAP_FIX_PLUGIN_VERSION", "1.2.7");
define("ADMIN_BAR_WRAP_FIX_PLUGIN_PRIMARY_FILE", __FILE__);
define("ADMIN_BAR_WRAP_FIX_PLUGIN_NAME", plugin_basename(__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");

function kzeni_admin_bar_wrap_fix_plugin_extra_links($links, $plugin_name)
{
if ($plugin_name != ADMIN_BAR_WRAP_FIX_PLUGIN_NAME) {
return $links;
}
$links[] =
'<a href="https://github.com/KZeni/Admin-Bar-Wrap-Fix" target="_blank">' .
__("GitHub", "kzeni_disable_theme_plugin_update_emails") .
"</a>";
$links[] =
'<a href="https://wordpress.org/support/plugin/admin-bar-wrap-fix/reviews/" target="_blank">' .
__("Reviews", "kzeni_disable_theme_plugin_update_emails") .
"</a>";
$links[] =
'<a href="https://wordpress.org/support/plugin/admin-bar-wrap-fix/" target="_blank">' .
__("Support", "kzeni_disable_theme_plugin_update_emails") .
"</a>";
$links[] =
'<a href="https://core.trac.wordpress.org/ticket/28983" target="_blank">' .
__("Core Trac Ticket", "kzeni_disable_theme_plugin_update_emails") .
"</a>";
$links[] =
'<a href="https://github.com/WordPress/wordpress-develop/pull/1082" target="_blank">' .
__("Core GitHub Pull Request", "kzeni_disable_theme_plugin_update_emails") .
"</a>";
return $links;
}
add_filter(
"plugin_row_meta",
"kzeni_admin_bar_wrap_fix_plugin_extra_links",
10,
2
);
13 changes: 11 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: KZeni
Donate link: https://www.paypal.me/KZeni
License: GPLv3
Tags: Admin Bar, adminbar, ui, ui fix, overflow, wrapping
Stable tag: 1.2.6
Tested up to: 6.3
Stable tag: 1.2.7
Tested up to: 6.4
Requires at least: 4.6
Requires PHP: 5.4

Expand All @@ -30,6 +30,15 @@ I would think so. This has been submitted as a patch at [core ticket #44438](htt

== Changelog ==

= 1.2.7 =

Released October 24th, 2023

* Added links to the plugin details on the main plugin page.
* Confirmed WordPress 6.4 compliance.

== Changelog ==

= 1.2.6 =

Released July 24th, 2023
Expand Down

0 comments on commit 28cf4cc

Please sign in to comment.