Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TGM 'Warning: sprintf(): Too few arguments...' bugfix
/**
* Sets install skin strings for each individual plugin.
*
* Checks to see if the automatic activation flag is set and uses the
* the proper strings accordingly.
*
* @since 2.2.0
*/
public function add_strings() {
if ( 'update' === $this->options['install_type'] ) {
parent::add_strings();
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
} else {
/* translators: 1: plugin name, 2: error message. */
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' );
if ( $this->tgmpa->is_automatic ) {
// Automatic activation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = __( '%1$s done.' );
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
} else {
// Default installation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = __( '%1$s done.' );
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
}
}
}
@Khaled56

This comment has been minimized.

Show comment
Hide comment
@Khaled56

Khaled56 Sep 19, 2017

hello, i changed that text, but still facing that warning, can you help me?please,

hello, i changed that text, but still facing that warning, can you help me?please,

@dharmeshtops

This comment has been minimized.

Show comment
Hide comment
@dharmeshtops

dharmeshtops Sep 21, 2017

now working.

now working.

@Ishtiaque-Shaad

This comment has been minimized.

Show comment
Hide comment
@Ishtiaque-Shaad

Ishtiaque-Shaad Sep 26, 2017

sorry... I can't make it work in 2.6.1

sorry... I can't make it work in 2.6.1

@claash

This comment has been minimized.

Show comment
Hide comment
@claash

claash Apr 22, 2018

Wordpress 4.9.5, TGM 2.6.1. It's work, thanks.

claash commented Apr 22, 2018

Wordpress 4.9.5, TGM 2.6.1. It's work, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment