File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434define ( 'BENCHPRESS_PLUGIN_DIR ' , plugin_dir_path ( __FILE__ ) );
3535define ( 'BENCHPRESS_VERSION ' , '1.0.2 ' );
3636
37+ // Create variable for settings link filter.
38+ $ plugin_name = plugin_basename ( __FILE__ );
39+
40+ /**
41+ * Add settings link on plugin page
42+ *
43+ * @param array $links an array of links related to the plugin.
44+ *
45+ * @since 1.1.0
46+ * @return array updatead array of links related to the plugin.
47+ */
48+ function benchpress_settings_link ( $ links ) {
49+ // Settings link.
50+ $ settings_link = '<a href="admin.php?page=benchpress"> ' . esc_html__ ( 'Settings ' , 'benchpress ' ) . '</a> ' ;
51+ // Add the settings link to the $links array.
52+ array_unshift ( $ links , $ settings_link );
53+
54+ return $ links ;
55+ }
56+ add_filter ( "plugin_action_links_ $ plugin_name " , 'benchpress_settings_link ' );
57+
3758// Add the Plugin Update Checker.
3859require 'vendor/plugin-update-checker/plugin-update-checker.php ' ;
3960use YahnisElsts \PluginUpdateChecker \v5 \PucFactory ;
You can’t perform that action at this time.
0 commit comments