Skip to content

Commit f4ef350

Browse files
committed
Added settings link
1 parent d6e3896 commit f4ef350

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

includes/admin/class-admin.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ public function __construct() {
6767
$this->admin_notices_api = new Admin_Notices_API();
6868
$this->settings_wizard = new Settings_Wizard();
6969
$this->admin_banner = new Admin_Banner( $this->get_admin_banner_config() );
70+
71+
add_filter( 'plugin_action_links_' . plugin_basename( WZ_CBH_PLUGIN_FILE ), array( $this, 'plugin_action_links' ) );
72+
}
73+
74+
/**
75+
* Add action links to the plugin listing page.
76+
*
77+
* @since 1.1.0
78+
*
79+
* @param array<string, string> $links Existing action links.
80+
* @return array<string, string> Modified action links.
81+
*/
82+
public function plugin_action_links( array $links ): array {
83+
$settings_link = sprintf(
84+
'<a href="%s">%s</a>',
85+
esc_url( admin_url( 'options-general.php?page=wz_cbh_settings' ) ),
86+
esc_html__( 'Settings', 'webberzone-code-block-highlighting' )
87+
);
88+
89+
array_unshift( $links, $settings_link );
90+
91+
return $links;
7092
}
7193

7294
/**

0 commit comments

Comments
 (0)