From ada838a1e4d539c67c3e9eebfcfc8dc7c24ff18b Mon Sep 17 00:00:00 2001 From: magdev Date: Wed, 4 Feb 2026 10:09:15 +0100 Subject: [PATCH] Add Dashboard link to plugin action links on plugins page Co-Authored-By: Claude Opus 4.5 --- wp-bnb.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp-bnb.php b/wp-bnb.php index eb8dc8d..8b40445 100644 --- a/wp-bnb.php +++ b/wp-bnb.php @@ -189,3 +189,23 @@ function wp_bnb_deactivate(): void { } register_deactivation_hook( __FILE__, 'wp_bnb_deactivate' ); + +/** + * Add action links to the plugins page. + * + * @param array $links Existing plugin action links. + * @return array Modified plugin action links. + */ +function wp_bnb_plugin_action_links( array $links ): array { + $dashboard_link = sprintf( + '%s', + esc_url( admin_url( 'admin.php?page=wp-bnb' ) ), + esc_html__( 'Dashboard', 'wp-bnb' ) + ); + + array_unshift( $links, $dashboard_link ); + + return $links; +} + +add_filter( 'plugin_action_links_' . WP_BNB_BASENAME, 'wp_bnb_plugin_action_links' );