Skip to content

Commit

Permalink
Update TGMPA
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Olaru committed May 1, 2020
1 parent c8ef538 commit 1148a1e
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions inc/admin/required-plugins/class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* or theme author for support.
*
* @package TGM-Plugin-Activation
* @version 2.6.5 for parent theme Rosa2 Lite for publication on WordPress.org
* @version 2.6.5 for Theme
* @link http://tgmpluginactivation.com/
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
* @copyright Copyright (c) 2011, Thomas Griffin
Expand Down Expand Up @@ -55,7 +55,7 @@ class TGM_Plugin_Activation {
*
* @const string Version number.
*/
const TGMPA_VERSION = '2.6.5';
const TGMPA_VERSION = '2.6.5'; // Version bump by Pixelgrade!!!

/**
* Regular expression to test if a URL is a WP plugin repo URL.
Expand Down Expand Up @@ -1023,6 +1023,12 @@ public function notices() {
return;
}

// Pixelgrade addition!!!
// Allow others to prevent notices.
if ( ! apply_filters( 'tgmpa_show_admin_notices', true ) ) {
return;
}

// Store for the plugin slugs by message type.
$message = array();

Expand Down Expand Up @@ -1085,6 +1091,13 @@ public function notices() {
}
unset( $slug, $plugin );

// Pixelgrade addition!!!
// Allow others to filter notices.
$message = apply_filters( 'tgmpa_admin_notices', $message, $total_required_action_count, $install_link_count, $activate_link_count, $update_link_count, $this );
// Pixelgrade addition!!!
// Allow others to filter notices total required action count.
$total_required_action_count = apply_filters( 'tgmpa_admin_notices_total_required_action_count', $total_required_action_count, $this );

// If we have notices to display, we move forward.
if ( ! empty( $message ) || $total_required_action_count > 0 ) {
krsort( $message ); // Sort messages.
Expand Down Expand Up @@ -1333,7 +1346,7 @@ public function register( $plugin ) {
* @param string $plugin_slug
*/
public function deregister( $plugin_slug ) {
if ( empty( $plugin_slug ) || ! is_string( $plugin_slug ) || isset( $this->plugins[ $plugin_slug ] ) ) {
if ( empty( $plugin_slug ) || ! is_string( $plugin_slug ) || ! isset( $this->plugins[ $plugin_slug ] ) ) {
return;
}

Expand Down Expand Up @@ -3531,15 +3544,15 @@ public function add_strings() {
// Automatic activation strings.
$this->upgrader->strings['skin_upgrade_start'] = esc_html__( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', '__theme_txtd' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed and activated successfully.', '__theme_txtd' );
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed and activated successfully.', '__theme_txtd' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', '__theme_txtd' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', '__theme_txtd' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = esc_html__( 'All installations and activations have been completed.', '__theme_txtd' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = esc_html__( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', '__theme_txtd' );
} else {
// Default installation strings.
$this->upgrader->strings['skin_upgrade_start'] = esc_html__( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', '__theme_txtd' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', '__theme_txtd' );
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', '__theme_txtd' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', '__theme_txtd' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', '__theme_txtd' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = esc_html__( 'All installations have been completed.', '__theme_txtd' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = esc_html__( 'Installing Plugin %1$s (%2$d/%3$d)', '__theme_txtd' );
Expand Down

0 comments on commit 1148a1e

Please sign in to comment.