From c06c59913bae744330a760620dfae7a6d76e6717 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 11 May 2015 20:40:11 +0200 Subject: [PATCH] Add TGMPA version nr to table and update pages. Fixes #399 --- class-tgm-plugin-activation.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index fc87917d..581c97df 100644 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -661,7 +661,6 @@ public function install_plugins_page() { display(); ?> - show_tgmpa_version(); + // Display message based on if all plugins are now active or not. if ( $this->is_tgmpa_complete() ) { echo '

', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '' ), '

'; @@ -813,7 +814,6 @@ protected function do_plugin_install() { } else { echo '

', esc_html( $this->strings['return'] ), '

'; } - return true; } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { @@ -1893,6 +1893,15 @@ public function force_deactivation() { } + /** + * Echo the current TGMPA version number to the page. + */ + public function show_tgmpa_version() { + echo '

', + sprintf( _x( 'TGMPA v %s', '%s = version number', 'tgmpa' ), self::TGMPA_VERSION ), + '

'; + } + /** * Returns the singleton instance of the class. * @@ -2586,6 +2595,19 @@ public function wp_plugin_update_row( $slug, $item ) { '; } + /** + * Extra controls to be displayed between bulk actions and pagination. + * + * @since 2.5.0 + * + * @param string $which 'top' or 'bottom' table navigation + */ + public function extra_tablenav( $which ) { + if ( 'bottom' === $which ) { + $this->tgmpa->show_tgmpa_version(); + } + } + /** * Defines the bulk actions for handling registered plugins. * @@ -3399,6 +3421,8 @@ public function bulk_footer() { // Flush plugins cache so we can make sure that the installed plugins list is always up to date. wp_clean_plugins_cache(); + $this->tgmpa->show_tgmpa_version(); + // Display message based on if all plugins are now active or not. $update_actions = array(); @@ -3414,12 +3438,12 @@ public function bulk_footer() { } /** - * Filter the list of action links available following bulk plugin updates. + * Filter the list of action links available following bulk plugin installs/updates. * * @since 2.5.0 * * @param array $update_actions Array of plugin action links. - * @param array $plugin_info Array of information for the last-updated plugin. + * @param array $plugin_info Array of information for the last-handled plugin. */ $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );