Skip to content

Commit f75f1e1

Browse files
committed
Add link to settings page on the plugins page
1 parent 28c6f44 commit f75f1e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

plugins/bcc-post-update-translations-notifier/bcc-post-update-translations-notifier.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function __construct() {
4646

4747
// Handle clearing logs
4848
add_action( 'admin_post_acf_tn_clear_logs', array( $this, 'handle_clear_logs' ) );
49+
50+
// Add settings link to plugins page
51+
add_filter( 'plugin_action_links_' . $this->plugin, array( $this, 'add_settings_page_link' ) );
4952
}
5053

5154
/**
@@ -220,6 +223,15 @@ public function admin_menu() {
220223
);
221224
}
222225

226+
/**
227+
* Add settings link to plugin actions on plugins page.
228+
*/
229+
public function add_settings_page_link( $links ) {
230+
$settings_link = '<a href="' . admin_url( 'options-general.php?page=post-update-translations-notifier' ) . '">' . __( 'Settings' ) . '</a>';
231+
array_unshift( $links, $settings_link );
232+
return $links;
233+
}
234+
223235
public function admin_init() {
224236
register_setting( 'post_update_translations_notifier_group', self::OPTION_FROM_EMAIL );
225237
register_setting( 'post_update_translations_notifier_group', self::OPTION_EMAILS, array( $this, 'sanitize_emails_callback' ) );

0 commit comments

Comments
 (0)