Skip to content

Commit

Permalink
Rename utility class
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl authored and GaryJones committed Jul 14, 2015
1 parent 3e8d4dd commit f640c41
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ public function notices() {
unset( $plugin_slug );

$count = count( $plugin_group );
$linked_plugins = array_map( array( 'TGM_Utils', 'wrap_in_em' ), $linked_plugins );
$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
$last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
$imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );

Expand Down Expand Up @@ -1229,9 +1229,9 @@ public function register( $plugin ) {
// Forgive users for using string versions of booleans or floats for version number.
$plugin['version'] = (string) $plugin['version'];
$plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
$plugin['required'] = TGM_Utils::validate_bool( $plugin['required'] );
$plugin['force_activation'] = TGM_Utils::validate_bool( $plugin['force_activation'] );
$plugin['force_deactivation'] = TGM_Utils::validate_bool( $plugin['force_deactivation'] );
$plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] );
$plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );

// Enrich the received data.
$plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
Expand Down Expand Up @@ -2776,7 +2776,7 @@ public function process_bulk_actions() {
echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
} else {
$count = count( $plugin_names ); // Count so we can use _n function.
$plugin_names = array_map( array( 'TGM_Utils', 'wrap_in_strong' ), $plugin_names );
$plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
$last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
$imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );

Expand Down Expand Up @@ -3413,19 +3413,21 @@ public function after_flush_output() {
}
}

if ( ! class_exists( 'TGM_Utils' ) ) {
if ( ! class_exists( 'TGMPA_Utils' ) ) {

/**
* Generic utilities for TGMPA.
*
* All methods are static, poor-dev name-spacing class wrapper.
*
* Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
*
* @since 2.5.0
*
* @package TGM-Plugin-Activation
* @author Juliette Reinders Folmer
*/
class TGM_Utils {
class TGMPA_Utils {
/**
* Whether the PHP filter extension is enabled.
*
Expand Down Expand Up @@ -3536,5 +3538,5 @@ protected static function emulate_filter_bool( $value ) {

return false;
}
} // End of class TGM_Utils
} // End of class TGMPA_Utils
} // End of class_exists wrapper

0 comments on commit f640c41

Please sign in to comment.