Closed wpsmith closed 10 years ago
Then this will impact the Install link, so something like this should be added:
/** 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 */
elseif ( ! isset( $installed_plugins[$item['file_path']] ) ) {
$actions = array(
'install' => sprintf(
'<a href="%1$s" title="Install %2$s">Install</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']
),
);
}
Currently, to me the differences between external_link and source are so subtle and I am not sure the functional difference. According to tgmpa.com:
So I think tgmpa should answer the following questions:
And regardless, I think the class needs something different from these. Consider the user who would like to use the class to recommend other premium plugins from CodeCanyon or even Soliloquywp.com. I believe an additional option is needed, one that does not add an Install hover link but a Purchase hover link.
Here are some options
Assuming option #2:
Assuming option #3:
I favor option 2.