Plugin Directory

Changeset 2592089


Ignore:
Timestamp:
09/01/2021 12:54:07 PM (5 years ago)
Author:
veks
Message:

обновление 2.3.0

Location:
button-visually-impaired/trunk
Files:
1 added
4 edited

Legend:

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

    r2592074 r2592089  
    2525define( 'BVI_DIR_PATH', plugin_dir_path( __FILE__ ) );
    2626define( 'BVI_URL', plugin_dir_url( __FILE__ ) );
     27define( 'BVI_FILE', __FILE__ );
    2728define( 'BVI_LANG_PATH', dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    2829
     
    7475}
    7576
     77if ( class_exists( '\\Bvi\\Core\\Upgrade' ) ) {
    7678
    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  
    1616     */
    1717    class Activate extends Core {
    18 
    19         /**
    20          * @var Core $core
    21          */
    22         public Core $core;
    2318
    2419        /**
     
    6257                'bviLinkColor'      => '#ffffff',
    6358                'bviLinkBg'         => '#e53935',
    64             ] )->registerOption();
     59            ] )->register();
    6560        }
    6661    }
  • button-visually-impaired/trunk/include/src/Core/Core.php

    r2591995 r2592089  
    7777         * Register option.
    7878         */
    79         public function registerOption() {
     79        public function register() {
    8080            if ( false === $this->getOption() ) {
    8181                add_option( $this->pluginOptionName, $this->pluginSetOption );
  • button-visually-impaired/trunk/include/src/Core/Loader.php

    r2587977 r2592089  
    9393            $classes = [];
    9494
    95             foreach ( $this->getClasses() as $class ) {
     95            foreach ( $this->classes as $class ) {
    9696                $classes[] = new $class;
    9797            }
Note: See TracChangeset for help on using the changeset viewer.