Skip to content

Commit

Permalink
Merge pull request #532 from WordImpress/issue/531
Browse files Browse the repository at this point in the history
New links on the plugin settings page Fixes #531
  • Loading branch information
Devin Walker committed Mar 21, 2016
2 parents 7988e55 + 50ccf60 commit d25e5b3
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
80 changes: 80 additions & 0 deletions includes/admin/plugins.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
/**
* Admin Plugins
*
* @package Give
* @subpackage Admin/Plugins
* @copyright Copyright (c) 2016, WordImpress
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.3.7
*/


// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}


/**
* Plugins row action links
*
* @since 1.3.7
*
* @param array $links already defined action links
* @param string $file plugin file path and name being processed
*
* @return array $links
*/
function give_plugin_action_links( $links, $file ) {
$settings_link = '<a href="' . admin_url( 'edit.php?post_type=give&page=give-settings' ) . '">' . esc_html__( 'Settings', 'give' ) . '</a>';
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(
'<a href="' . $give_docs_link . '" target="_blank">' . esc_html__( 'Documentation', 'give' ) . '</a>',
'<a href="' . $give_addons_link . '" target="_blank">' . esc_html__( 'Add-ons', 'give' ) . '</a>',
);

$input = array_merge( $input, $links );

return $input;
}

add_filter( 'plugin_row_meta', 'give_plugin_row_meta', 10, 2 );
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d25e5b3

Please sign in to comment.