Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin-plugins): display activation banner immediately upon activation refresh #3153 #3194

Merged
merged 2 commits into from May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion includes/admin/class-addon-activation-banner.php
Expand Up @@ -492,10 +492,11 @@ public function remove_addon_activate_meta() {
* Get list of add-on last activated.
*
* @since 2.1.0
*
* @return mixed|array
*/
public function get_recently_activated_addons() {
return get_option( 'give_recently_activated_addons', array() );
return give_get_recently_activated_addons();
}

/**
Expand Down
16 changes: 15 additions & 1 deletion includes/admin/plugins.php
Expand Up @@ -142,8 +142,11 @@ function give_recently_activated_addons() {
break;
}


if ( ! empty( $plugins ) ) {
$give_addons = array();

$give_addons = give_get_recently_activated_addons();

foreach ( $plugins as $plugin ) {
// Get plugins which has 'Give-' as prefix.
if ( stripos( $plugin, 'Give-' ) !== false ) {
Expand Down Expand Up @@ -399,3 +402,14 @@ function give_plugin_notice_css() {
}

add_action( 'admin_head', 'give_plugin_notice_css' );

/**
* Get list of add-on last activated.
*
* @since 2.1.3
*
* @return mixed|array list of recently activated add-on
*/
function give_get_recently_activated_addons() {
return get_option( 'give_recently_activated_addons', array() );
}