Changeset 2592037
- Timestamp:
- 09/01/2021 11:16:24 AM (4 years ago)
- Location:
- button-visually-impaired/trunk
- Files:
-
- 2 edited
-
Button-visually-impaired.php (modified) (1 diff)
-
functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
button-visually-impaired/trunk/Button-visually-impaired.php
r2592024 r2592037 72 72 Bvi\Core\Activate::getInstance()->activation(); 73 73 } ); 74 75 add_action( 'upgrader_process_complete', function ( $upgrader_object, $options ) {76 // The path to our plugin's main file77 $our_plugin = plugin_basename( __FILE__ );78 79 // If an update has taken place and the updated type is plugins and the plugins element exists80 if ( $options['action'] === 'update' && $options['type'] === 'plugin' && isset( $options['plugins'] ) ) {81 82 // Iterate through the plugins being updated and check if ours is there83 foreach ( $options['plugins'] as $plugin ) {84 if ( $plugin == $our_plugin ) {85 \Bvi\Core\Activate::getInstance()->activation();86 }87 }88 }89 } );90 74 } -
button-visually-impaired/trunk/functions.php
r2592024 r2592037 9 9 } ); 10 10 } 11 12 add_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 25 add_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.