Skip to content

Commit

Permalink
Merge pull request aspirepress#298 from namithj/aspirepress#295
Browse files Browse the repository at this point in the history
Create settings link for the plugin in the plugin listing page
  • Loading branch information
namithj authored Feb 20, 2025
2 parents 0d64ce9 + 1c81b41 commit 3541d49
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion includes/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class Admin_Settings {
* The Constructor.
*/
public function __construct() {

add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', [ $this, 'register_admin_menu' ] );
add_filter( 'plugin_action_links_aspireupdate/aspire-update.php', [ $this, 'plugin_action_links' ] );
add_action( 'admin_init', [ $this, 'reset_settings' ] );
add_action( 'admin_init', [ $this, 'register_settings' ] );
add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'admin_notices' ] );
Expand Down Expand Up @@ -295,6 +295,22 @@ public function update_settings() {
}
}

/**
* Set the plugin row's action links.
*
* @param array $links The existing action links.
* @return array The modified action links.
*/
public function plugin_action_links( $links ) {
$settings_url = network_admin_url( 'index.php?page=aspireupdate-settings' );
return array_merge(
[
'settings' => '<a href="' . esc_url( $settings_url ) . '">' . __( 'Settings', 'aspireupdate' ) . '</a>',
],
$links
);
}

/**
* Register the Admin Menu.
*
Expand Down

0 comments on commit 3541d49

Please sign in to comment.