Plugin Directory

Changeset 2592192


Ignore:
Timestamp:
09/01/2021 03:24:16 PM (4 years ago)
Author:
veks
Message:

update v2.3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • button-visually-impaired/trunk/include/src/Core/Upgrade.php

    r2592178 r2592192  
    4242         */
    4343        public function updateProcessComplete( \WP_Upgrader $upgrader, array $hook_extra ) {
     44            $updated = false;
    4445            if ( is_array( $hook_extra ) && array_key_exists( 'action', $hook_extra ) && array_key_exists( 'type', $hook_extra ) && array_key_exists( 'plugins', $hook_extra ) ) {
    4546                if ( $hook_extra['action'] == 'update' && $hook_extra['type'] == 'plugin' && is_array( $hook_extra['plugins'] ) && ! empty( $hook_extra['plugins'] ) ) {
     
    4748                    foreach ( $hook_extra['plugins'] as $key => $plugin ) {
    4849                        if ( $this_plugin == $plugin ) {
     50                            $updated = true;
    4951                            set_transient( 'bvi_updated', 1 );
    5052                            break;
     
    5456                }
    5557            }
     58
     59            if ( ! $updated ) {
     60                return;
     61            }
     62
     63            Activate::getInstance()->activation();
    5664        }
    5765
     
    6573        }
    6674
    67         function notice() {
    68             // Check the transient to see if we've just updated the plugin
    69             if ( get_transient( 'bvi_updated' ) ) {
    70                 echo '<div class="notice notice-success"> update</div>';
    71                 delete_transient( 'bvi_updated' );
    72             }
    73         }
    74 
    7575        /**
    7676         * Register hook.
     
    7979            add_action( 'upgrader_process_complete', [ $this, 'updateProcessComplete' ], 10, 2 );
    8080            add_action( 'plugins_loaded', [ $this, 'updatePlugin' ] );
    81             add_action( 'admin_notices', [ $this, 'notice' ] );
    8281        }
    8382    }
Note: See TracChangeset for help on using the changeset viewer.