Skip to content

Commit df30da1

Browse files
author
Balazs P
committed
Add plugin action links
1 parent 257c475 commit df30da1

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

includes/class-h2wp-admin-page.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public static function init() {
1515
add_action( 'admin_menu', array( __CLASS__, 'add_menu_page' ) );
1616
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
1717
add_action( 'admin_notices', array( __CLASS__, 'display_rate_limit_notice' ) );
18+
add_filter( 'plugin_action_links_' . H2WP_PLUGIN_BASENAME, array( __CLASS__, 'add_action_links' ) );
1819
}
1920

2021
/**
@@ -364,4 +365,17 @@ public static function display_rate_limit_notice() {
364365
delete_transient( 'h2wp_rate_limit_reached' );
365366
}
366367
}
368+
369+
/**
370+
* Add action links to the plugin list: Settings and Add Plugin.
371+
*
372+
* @param array $links Plugin action links.
373+
* @return array
374+
*/
375+
public static function add_action_links( $links ) {
376+
$settings_link = '<a href="' . esc_url( admin_url( 'options-general.php?page=h2wp_settings_page' ) ) . '">' . esc_html__( 'Settings', 'hub2wp' ) . '</a>';
377+
$add_plugin_link = '<a href="' . esc_url( admin_url( 'plugins.php?page=h2wp-plugin-browser' ) ) . '">' . esc_html__( 'Add GitHub Plugin', 'hub2wp' ) . '</a>';
378+
array_unshift( $links, $settings_link, $add_plugin_link );
379+
return $links;
380+
}
367381
}

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ hub2wp does not require any changes to existing plugins or approvals from a cent
2727
Currently, hub2wp checks the `Stable tag:` version in the default branch of the repository to manage updates. In the future, support for GitHub releases will be added, prioritizing them for update monitoring if the repository uses the releases feature.
2828

2929
3. **Installation**:
30-
- Download the latest release from the [Releases](https://github.com/YourGithubUsername/hub2wp/releases) page.
30+
- Download the latest release from the [Releases](https://github.com/WP-Autoplugin/hub2wp/releases) page.
3131
- Upload the ZIP file via the 'Plugins' screen in WordPress or extract it to the `/wp-content/plugins/` directory.
3232
- Activate hub2wp from the 'Plugins' menu.
3333
- Start exploring GitHub plugins under “Plugins > Add GitHub Plugin.”
@@ -92,7 +92,7 @@ Not yet, but support for private repositories is planned for a future release.
9292

9393
## Contribution
9494

95-
hub2wp is open source and welcomes contributions. If you encounter issues or have suggestions, please create an issue or pull request in the [GitHub repository](https://github.com/YourGithubUsername/hub2wp).
95+
hub2wp is open source and welcomes contributions. If you encounter issues or have suggestions, please create an issue or pull request in the [GitHub repository](https://github.com/WP-Autoplugin/hub2wp).
9696

9797
---
9898

0 commit comments

Comments
 (0)