Changeset 2592089
- Timestamp:
- 09/01/2021 12:54:07 PM (5 years ago)
- Location:
- button-visually-impaired/trunk
- Files:
-
- 1 added
- 4 edited
-
Button-visually-impaired.php (modified) (2 diffs)
-
include/src/Core/Activate.php (modified) (2 diffs)
-
include/src/Core/Core.php (modified) (1 diff)
-
include/src/Core/Loader.php (modified) (1 diff)
-
include/src/Core/Upgrade.php (added)
Legend:
- Unmodified
- Added
- Removed
-
button-visually-impaired/trunk/Button-visually-impaired.php
r2592074 r2592089 25 25 define( 'BVI_DIR_PATH', plugin_dir_path( __FILE__ ) ); 26 26 define( 'BVI_URL', plugin_dir_url( __FILE__ ) ); 27 define( 'BVI_FILE', __FILE__ ); 27 28 define( 'BVI_LANG_PATH', dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 28 29 … … 74 75 } 75 76 77 if ( class_exists( '\\Bvi\\Core\\Upgrade' ) ) { 76 78 77 add_action( 'upgrader_process_complete', function ( \WP_Upgrader $upgrader, array $hook_extra ) { 78 79 if ( is_array( $hook_extra ) && array_key_exists( 'action', $hook_extra ) && array_key_exists( 'type', $hook_extra ) && array_key_exists( 'plugins', $hook_extra ) ) { 80 if ( $hook_extra['action'] == 'update' && $hook_extra['type'] == 'plugin' && is_array( $hook_extra['plugins'] ) && ! empty( $hook_extra['plugins'] ) ) { 81 $this_plugin = plugin_basename( __FILE__ ); 82 foreach ( $hook_extra['plugins'] as $key => $plugin ) { 83 if ( $this_plugin == $plugin ) { 84 set_transient( 'bvi_updated', 1 ); 85 break; 86 } 87 } 88 unset( $key, $plugin, $this_plugin ); 89 } 90 } 91 }, 10, 2 ); 92 93 add_action( 'plugins_loaded', function () { 94 if ( get_transient( 'bvi_updated' ) && current_user_can( 'administrator' ) ) { 95 96 if ( class_exists( '\\Bvi\\Core\\Activate' ) ) { 97 Bvi\Core\Activate::getInstance()->activation(); 98 } 99 100 delete_transient( 'bvi_updated' ); 101 } 102 }, 11, 0 ); 79 /** 80 * Upgrade plugin. 81 */ 82 Bvi\Core\Upgrade::getInstance()->register(); 83 } -
button-visually-impaired/trunk/include/src/Core/Activate.php
r2592074 r2592089 16 16 */ 17 17 class Activate extends Core { 18 19 /**20 * @var Core $core21 */22 public Core $core;23 18 24 19 /** … … 62 57 'bviLinkColor' => '#ffffff', 63 58 'bviLinkBg' => '#e53935', 64 ] )->register Option();59 ] )->register(); 65 60 } 66 61 } -
button-visually-impaired/trunk/include/src/Core/Core.php
r2591995 r2592089 77 77 * Register option. 78 78 */ 79 public function register Option() {79 public function register() { 80 80 if ( false === $this->getOption() ) { 81 81 add_option( $this->pluginOptionName, $this->pluginSetOption ); -
button-visually-impaired/trunk/include/src/Core/Loader.php
r2587977 r2592089 93 93 $classes = []; 94 94 95 foreach ( $this-> getClasses()as $class ) {95 foreach ( $this->classes as $class ) { 96 96 $classes[] = new $class; 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.