Plugin Directory

Changeset 2592037


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

обновление 2.3.0

Location:
button-visually-impaired/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • button-visually-impaired/trunk/Button-visually-impaired.php

    r2592024 r2592037  
    7272        Bvi\Core\Activate::getInstance()->activation();
    7373    } );
    74 
    75     add_action( 'upgrader_process_complete', function ( $upgrader_object, $options ) {
    76         // The path to our plugin's main file
    77         $our_plugin = plugin_basename( __FILE__ );
    78 
    79         // If an update has taken place and the updated type is plugins and the plugins element exists
    80         if ( $options['action'] === 'update' && $options['type'] === 'plugin' && isset( $options['plugins'] ) ) {
    81 
    82             // Iterate through the plugins being updated and check if ours is there
    83             foreach ( $options['plugins'] as $plugin ) {
    84                 if ( $plugin == $our_plugin ) {
    85                     \Bvi\Core\Activate::getInstance()->activation();
    86                 }
    87             }
    88         }
    89     } );
    9074}
  • button-visually-impaired/trunk/functions.php

    r2592024 r2592037  
    99    } );
    1010}
     11
     12add_action( 'upgrader_process_complete', function ( $upgrader_object, $options ) {
     13    $our_plugin = plugin_basename( __FILE__ );
     14
     15    if ( $options['action'] === 'update' && $options['type'] === 'plugin' && isset( $options['plugins'] ) ) {
     16
     17        foreach ( $options['plugins'] as $plugin ) {
     18            if ( $plugin == $our_plugin ) {
     19                set_transient( 'bvi_updated', 1 );
     20            }
     21        }
     22    }
     23} );
     24
     25add_action( 'plugins_loaded', function () {
     26    if ( get_transient( 'bvi_updated' ) && current_user_can( 'administrator' ) ) {
     27        Bvi\Core\Activate::getInstance()->activation();
     28        delete_transient( 'bvi_updated' );
     29    }
     30} );
Note: See TracChangeset for help on using the changeset viewer.