From 7d8868fd38e90505b363c78288aa9b9bafe13d02 Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Thu, 29 Feb 2024 11:00:57 -0800 Subject: [PATCH] Determine basename from `BLUEHOST_PLUGIN_FILE` --- inc/Admin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/Admin.php b/inc/Admin.php index 4cece537e..264e80231 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -25,7 +25,10 @@ public function __construct() { /* Load i18 files */ \add_action( 'init', array( __CLASS__, 'load_text_domain' ), 100 ); /* Add Links to WordPress Plugins list item. */ - \add_filter( 'plugin_action_links_bluehost-wordpress-plugin/bluehost-wordpress-plugin.php', array( __CLASS__, 'actions' ) ); + $plugin_basename = defined( 'BLUEHOST_PLUGIN_FILE' ) + ? plugin_basename( constant( 'BLUEHOST_PLUGIN_FILE' ) ) + : 'bluehost-wordpress-plugin/bluehost-wordpress-plugin.php'; + \add_filter( "plugin_action_links_{$plugin_basename}", array( __CLASS__, 'actions' ) ); /* Add inline style to hide subnav link */ \add_action( 'admin_head', array( __CLASS__, 'admin_nav_style' ) );