Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added "Purchase" hover link

  • Loading branch information...
commit a2c77ec817082c140de5fc46021c7f537fd60af1 1 parent a801473
@wpsmith authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 tgm-plugin-activation/class-tgm-plugin-activation.php
View
28 tgm-plugin-activation/class-tgm-plugin-activation.php
@@ -1317,6 +1317,34 @@ public function column_plugin( $item ) {
if ( is_plugin_active( $item['file_path'] ) )
$actions = array();
+ /** We need to display the 'Purchase' hover link */
+ if ( isset( $item['source'] ) && (
+ __( 'External Link', TGM_Plugin_Activation::$instance->domain ) != $item['source'] ||
+ __( 'Private Repository', TGM_Plugin_Activation::$instance->domain ) != $item['source'] ||
+ __( 'Pre-Packaged', TGM_Plugin_Activation::$instance->domain ) != $item['source'] ||
+ __( 'WordPress Repository', TGM_Plugin_Activation::$instance->domain ) != $item['source']
+ )
+ ) {
+ $actions = array(
+ 'install' => sprintf(
+ '<a href="%1$s" title="' . __( 'Purchase', TGM_Plugin_Activation::$instance->domain ) . ' %2$s">' . __( 'Purchase', TGM_Plugin_Activation::$instance->domain ) . '</a>',
+ wp_nonce_url(
+ add_query_arg(
+ array(
+ 'page' => TGM_Plugin_Activation::$instance->menu,
+ 'plugin' => $item['slug'],
+ 'plugin_name' => $item['sanitized_plugin'],
+ 'plugin_source' => $item['url'],
+ 'tgmpa-install' => 'install-plugin',
+ ),
+ admin_url( TGM_Plugin_Activation::$instance->parent_url_slug )
+ ),
+ 'tgmpa-install'
+ ),
+ $item['sanitized_plugin']
+ ),
+ );
+ }
/** We need to display the 'Install' hover link */
if ( ! isset( $installed_plugins[$item['file_path']] ) ) {
$actions = array(
Please sign in to comment.
Something went wrong with that request. Please try again.