Last active
September 29, 2023 12:08
-
-
Save al5dy/965d0eefffab32df3b04badbc2274d08 to your computer and use it in GitHub Desktop.
TGM 'Warning: sprintf(): Too few arguments...' bugfix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); | |
} | |
} | |
} |
Bingoo Its works fine.thank you .
Thank's, it's work for my theme 👍
I am facing this issue on 5.7.2 and this gist didn't fix it.
Solution:
In the add_strings() method, change the value of the $this->upgrader->strings['skin_update_successful'] property by removing the onclick="%2$s".
Solution: In the add_strings() method, change the value of the $this->upgrader->strings['skin_update_successful'] property by removing the onclick="%2$s".
It's worked for me, thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works for me. thanks
Version 2.6.1 WP 5.1