Skip to content

Commit

Permalink
Add TGMPA version nr to table and update pages.
Browse files Browse the repository at this point in the history
Fixes #399
  • Loading branch information
jrfnl committed May 11, 2015
1 parent 8a12e53 commit c06c599
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ public function install_plugins_page() {
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
<?php $plugin_table->display(); ?>
</form>

</div>
<?php

Expand Down Expand Up @@ -805,6 +804,8 @@ protected function do_plugin_install() {
}
}

$this->show_tgmpa_version();

// Display message based on if all plugins are now active or not.
if ( $this->is_tgmpa_complete() ) {
echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';
Expand All @@ -813,7 +814,6 @@ protected function do_plugin_install() {
} else {
echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
}

return true;

} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
Expand Down Expand Up @@ -1893,6 +1893,15 @@ public function force_deactivation() {

}

/**
* Echo the current TGMPA version number to the page.
*/
public function show_tgmpa_version() {
echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
sprintf( _x( 'TGMPA v %s', '%s = version number', 'tgmpa' ), self::TGMPA_VERSION ),
'</small></strong></p>';
}

/**
* Returns the singleton instance of the class.
*
Expand Down Expand Up @@ -2586,6 +2595,19 @@ public function wp_plugin_update_row( $slug, $item ) {
</tr>';
}

/**
* 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.
*
Expand Down Expand Up @@ -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();

Expand All @@ -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 );

Expand Down

0 comments on commit c06c599

Please sign in to comment.