From 1c4087563968938ffb74ad3fa4c1713b3f0fa20d Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Fri, 28 Jul 2023 12:20:08 -0600 Subject: [PATCH] adding a link to the settings page from the plugins list page --- includes/class-app.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/includes/class-app.php b/includes/class-app.php index db1d948..dec31ba 100644 --- a/includes/class-app.php +++ b/includes/class-app.php @@ -126,6 +126,8 @@ class App { // phpcs:enable // other logic here + add_filter( 'network_admin_plugin_action_links_nmsp-plugin-name/nmsp-plugin-name.php', array( $this, 'filter_plugin_action_links' ) ); + add_filter( 'plugin_action_links_nmsp-plugin-name/nmsp-plugin-name.php', array( $this, 'filter_plugin_action_links' ) ); } /** @@ -155,6 +157,26 @@ class App { require_once __DIR__ . '/front/class-custompage.php'; } + /** + * Description. + * + * @package PluginNamespace\App + * @since 1.0.0 + * + * @param array $actions + * + * @return array + */ + public function filter_plugin_action_links( array $actions = array() ): array { + $plugin_settings_url = admin_url( 'admin.php?page=nmsp-plugin-name-menu-slug' ); + return array_merge( + array( + 'settings' => '' . esc_html__( 'Settings', 'nmsp-plugin-name-text-domain' ) . '', + ), + $actions + ); + } + /** * Load BladeOne as the templating engine for the plugin. *