From 50ccf60bb456882b53216f46da9b85f4d307c389 Mon Sep 17 00:00:00 2001 From: Devin Walker Date: Mon, 21 Mar 2016 15:56:50 -0700 Subject: [PATCH] New links on the plugin settings page Fixes #531 --- give.php | 1 + includes/admin/plugins.php | 80 ++++++++++++++++++++++++++++++++++++++ readme.txt | 1 + 3 files changed, 82 insertions(+) create mode 100755 includes/admin/plugins.php diff --git a/give.php b/give.php index d3e214ff2e..51d040ea9b 100644 --- a/give.php +++ b/give.php @@ -315,6 +315,7 @@ private function includes() { require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php'; require_once GIVE_PLUGIN_DIR . 'includes/admin/export-functions.php'; require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; + require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php'; require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; diff --git a/includes/admin/plugins.php b/includes/admin/plugins.php new file mode 100755 index 0000000000..a8725088e7 --- /dev/null +++ b/includes/admin/plugins.php @@ -0,0 +1,80 @@ +' . esc_html__( 'Settings', 'give' ) . ''; + if ( $file == 'give/give.php' ) { + array_unshift( $links, $settings_link ); + } + + return $links; +} + +add_filter( 'plugin_action_links', 'give_plugin_action_links', 10, 2 ); + + +/** + * Plugin row meta links + * + * @since 1.3.7 + * + * @param array $input already defined meta links + * @param string $file plugin file path and name being processed + * + * @return array $input + */ +function give_plugin_row_meta( $input, $file ) { + if ( $file != 'give/give.php' ) { + return $input; + } + + $give_addons_link = esc_url( add_query_arg( array( + 'utm_source' => 'plugins-page', + 'utm_medium' => 'plugin-row', + 'utm_campaign' => 'admin', + ), 'https://givewp.com/addons/' ) + ); + + $give_docs_link = esc_url( add_query_arg( array( + 'utm_source' => 'plugins-page', + 'utm_medium' => 'plugin-row', + 'utm_campaign' => 'admin', + ), 'https://givewp.com/documentation/' ) + ); + + $links = array( + '' . esc_html__( 'Documentation', 'give' ) . '', + '' . esc_html__( 'Add-ons', 'give' ) . '', + ); + + $input = array_merge( $input, $links ); + + return $input; +} + +add_filter( 'plugin_row_meta', 'give_plugin_row_meta', 10, 2 ); diff --git a/readme.txt b/readme.txt index d07b39eccb..4170d20855 100644 --- a/readme.txt +++ b/readme.txt @@ -128,6 +128,7 @@ We also really like WooCommerce. It's hands-down the most robust eCommerce platf = 1.3.7 = * New: Unit tests added for Give_Donate_Form class - thanks @cklosowski - https://github.com/WordImpress/Give/pull/517 +* New: Added links to plugin settings page and documentation on the WordPress plugin listing page - https://github.com/WordImpress/Give/issues/531 * Tweak: Removed usage of the image size "give_form_thumbnail" in favor of "give_form_single" - https://github.com/WordImpress/Give/issues/412 * Fix: Transactions with a "cancelled" status are not shown in the wp-admin Transactions table - thanks @pryley - https://github.com/WordImpress/Give/issues/514