adding a link to the settings page from the plugins list page
This commit is contained in:
parent
d4aba69375
commit
1c40875639
@ -126,6 +126,8 @@ class App {
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
|
||||||
// other logic here
|
// 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';
|
require_once __DIR__ . '/front/class-custompage.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description.
|
||||||
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @param array<string, string> $actions
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
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' => '<a href="' . $plugin_settings_url . '">' . esc_html__( 'Settings', 'nmsp-plugin-name-text-domain' ) . '</a>',
|
||||||
|
),
|
||||||
|
$actions
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load BladeOne as the templating engine for the plugin.
|
* Load BladeOne as the templating engine for the plugin.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user