Wire up remaining placeholder settings, implement menu search (v2.4.0)
- Custom dashboard, Modern plugins page, and Modern comments page toggles previously had no effect at all — their respective takeovers/ redirects (DashboardTakeover, SubApps' Plugins/Comments handling, MenuSerializer's link rewrites) ran unconditionally regardless of the setting. All three now default to their previous always-on behavior but can actually be turned off. - Menu search had zero implementation. Sidebar.vue now shows a real search box (gated on the setting) that filters both the WP-native menu and the Aurora nav section by title, auto-expanding matching sections. - Removed "Modern posts table" and "Modern users page" toggles (and their now-empty Posts/Users settings categories) — both described a custom management page that was never built. A checkbox with nothing behind it is worse than no checkbox. Verified all four live: dashboard/plugins/comments toggles correctly flip between the Aurora and native experience and back; menu search filters correctly and clears back to the full menu. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
1578481106
commit
fb93888d3f
@@ -27,6 +27,13 @@ class DashboardTakeover
|
||||
|
||||
public static function is_dashboard()
|
||||
{
|
||||
// Settings > Dashboard > "Custom dashboard" — previously always on
|
||||
// regardless of this setting; default true so existing installs keep
|
||||
// their current behavior until explicitly turned off.
|
||||
if (!Settings::get("use_custom_dashboard", true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isset($GLOBALS["pagenow"]) && $GLOBALS["pagenow"] === "index.php";
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace AuroraAdmin\Pages;
|
||||
|
||||
use AuroraAdmin\Utility\Assets;
|
||||
use AuroraAdmin\Licensing\License;
|
||||
use AuroraAdmin\Options\Settings;
|
||||
|
||||
defined("ABSPATH") || exit();
|
||||
|
||||
@@ -111,6 +112,13 @@ class SubApps
|
||||
{
|
||||
global $pagenow;
|
||||
|
||||
// Settings > Comments > "Modern comments page" — previously always
|
||||
// redirected regardless of this setting; default true so existing
|
||||
// installs keep their current behavior until explicitly turned off.
|
||||
if (!Settings::get("modern_comments", true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($pagenow !== "edit-comments.php" || !current_user_can("edit_posts")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace AuroraAdmin\Shell;
|
||||
|
||||
use AuroraAdmin\Options\Settings;
|
||||
|
||||
defined("ABSPATH") || exit();
|
||||
|
||||
/**
|
||||
@@ -142,11 +144,14 @@ class MenuSerializer
|
||||
return "";
|
||||
}
|
||||
|
||||
if ($slug === "plugins.php") {
|
||||
// Both checks default to true so existing installs keep their current
|
||||
// behavior (previously always on regardless of these settings) until
|
||||
// explicitly turned off in Settings > Plugins / Settings > Comments.
|
||||
if ($slug === "plugins.php" && Settings::get("modern_plugins", true)) {
|
||||
return admin_url("plugins.php?page=aurora-admin-plugins");
|
||||
}
|
||||
|
||||
if ($slug === "edit-comments.php") {
|
||||
if ($slug === "edit-comments.php" && Settings::get("modern_comments", true)) {
|
||||
return admin_url("admin.php?page=aurora-admin-comments");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user