diff --git a/src/admin/class-footnotes-admin.php b/src/admin/class-footnotes-admin.php index 0eb8fe0..bf9a136 100644 --- a/src/admin/class-footnotes-admin.php +++ b/src/admin/class-footnotes-admin.php @@ -125,18 +125,18 @@ class Footnotes_Admin { * * @since 1.5.0 * @since 2.8.0 Moved into `Footnote_Admin` class. - * @param array $plugin_links The WP-default set of links to display. + * @param string[] $links The default set of links to display. * @return string[] The full set of links to display. */ - public static function get_plugin_links( array $plugin_links ): array { + public function footnotes_action_links( array $links ): array { // Append link to the WordPress Plugin page. - $plugin_links[] = sprintf( '%s', __( 'Support', 'footnotes' ) ); + $links[] = sprintf( '%s', __( 'Support', 'footnotes' ) ); // Append link to the settings page. - $plugin_links[] = sprintf( '%s', admin_url( 'options-general.php?page=footnotes' ), __( 'Settings', 'footnotes' ) ); + $links[] = sprintf( '%s', esc_url( admin_url( 'options-general.php?page=footnotes' ) ), __( 'Settings', 'footnotes' ) ); // Append link to the PayPal donate function. - $plugin_links[] = sprintf( '%s', __( 'Donate', 'footnotes' ) ); - // Return new links. - return $plugin_links; + $links[] = sprintf( '%s', __( 'Donate', 'footnotes' ) ); + + return $links; } } diff --git a/src/includes/class-footnotes.php b/src/includes/class-footnotes.php index 14ae38a..e8350e3 100644 --- a/src/includes/class-footnotes.php +++ b/src/includes/class-footnotes.php @@ -164,8 +164,7 @@ class Footnotes { $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); - $this->loader->add_filter( 'admin_get_plugin_links', $plugin_admin, 'get_plugin_links', 10, 1 ); - + $this->loader->add_filter('plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'footnotes_action_links'); } /**