';
if ( ! current_user_can( 'update_plugins' ) ) {
printf( __('There is a new version of %1$s available.
View version %4$s details.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
} elseif ( empty($r->package) ) {
printf( __('There is a new version of %1$s available.
View version %4$s details.
Automatic update is unavailable for this plugin.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
} else {
printf( __( 'There is a new version of %1$s available.
View version %4$s details or
update now.' ), $plugin_name, esc_url( $details_url ), esc_attr( $plugin_name ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ) );
}
/**
* Fires at the end of the update message container in each
* row of the plugins list table.
*
* The dynamic portion of the hook name, `$file`, refers to the path
* of the plugin's primary file relative to the plugins directory.
*
* @since 2.8.0
*
* @param array $plugin_data {
* An array of plugin metadata.
*
* @type string $name The human-readable name of the plugin.
* @type string $plugin_uri Plugin URI.
* @type string $version Plugin version.
* @type string $description Plugin description.
* @type string $author Plugin author.
* @type string $author_uri Plugin author URI.
* @type string $text_domain Plugin text domain.
* @type string $domain_path Relative path to the plugin's .mo file(s).
* @type bool $network Whether the plugin can only be activated network wide.
* @type string $title The human-readable title of the plugin.
* @type string $author_name Plugin author's name.
* @type bool $update Whether there's an available update. Default null.
* }
* @param array $r {
* An array of metadata about the available plugin update.
*
* @type int $id Plugin ID.
* @type string $slug Plugin slug.
* @type string $new_version New plugin version.
* @type string $url Plugin URL.
* @type string $package Plugin update package URL.
* }
*/
do_action( "in_plugin_update_message-{$file}", $plugin_data, $r );
echo '