Skip to content

Commit 0ee6930

Browse files
authored
Add plugin settings link (#181)
* Add plugin settings link
1 parent 9cd7ba6 commit 0ee6930

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

wc-smooth-generator.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,20 @@ function load_wc_smooth_generator() {
5757
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
5858
}
5959
} );
60+
61+
/**
62+
* Show action links on the plugin screen.
63+
*
64+
* @param array $links Plugin Action links.
65+
*
66+
* @return array
67+
*/
68+
function wc_smooth_generator_plugin_action_links( $links ) {
69+
$action_links = array(
70+
'settings' => '<a href="' . esc_url( admin_url( 'tools.php?page=smoothgenerator' ) ) . '" aria-label="' . esc_attr__( 'View WooCommerce Smooth Generator settings', 'wc-smooth-generator' ) . '">' . esc_html__( 'Settings', 'wc-smooth-generator' ) . '</a>',
71+
);
72+
73+
return array_merge( $action_links, $links );
74+
}
75+
76+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wc_smooth_generator_plugin_action_links' );

0 commit comments

Comments
 (0)