芝麻web文件管理V1.00
编辑当前文件:/home/ephorei/www/wp-content/plugins/ultimate-addons-for-gutenberg/classes/class-uagb-update.php
fresh_install_update_asset_generation_option(); // Update current version. update_option( 'uagb-version', UAGB_VER ); return; } do_action( 'uagb_update_before' ); // If equals then return. if ( version_compare( $saved_version, UAGB_VER, '=' ) ) { return; } // If user is older than 2.0.0 then set the option. if ( version_compare( $saved_version, '2.0.0', '<' ) ) { update_option( 'uagb-old-user-less-than-2', 'yes' ); } // Enable Legacy Blocks for users older than 2.0.5. if ( version_compare( $saved_version, '2.0.5', '<' ) ) { UAGB_Admin_Helper::update_admin_settings_option( 'uag_enable_legacy_blocks', 'yes' ); } // If user is older than equal to 2.12.1 then set the option. if ( version_compare( $saved_version, '2.12.1', '<=' ) ) { UAGB_Admin_Helper::update_admin_settings_option( 'uag_enable_quick_action_sidebar', 'disabled' ); } // Delete any of the unused options that have been unsupported or no longer required. // Delete the header titlebar option if it exists- which has been removed from version 2.14.1. if ( UAGB_Admin_Helper::get_admin_settings_option( 'uag_enable_header_titlebar' ) ) { UAGB_Admin_Helper::delete_admin_settings_option( 'uag_enable_header_titlebar' ); } // Create a Core Block Array for all versions in which a Core Spectra Block was added. $core_blocks = array(); $blocks_status = UAGB_Admin_Helper::get_admin_settings_option( '_uagb_blocks' ); // If Block Statuses exists and is not empty, enable the required Core Spectra Blocks. if ( is_array( $blocks_status ) && ! empty( $blocks_status ) ) { // If user is older than 2.0.16 then enable all the Core Spectra Blocks, as we have removed option to disable core blocks from 2.0.16. if ( version_compare( $saved_version, '2.0.16', '<' ) ) { array_push( $core_blocks, 'container', 'advanced-heading', 'image', 'buttons', 'info-box', 'call-to-action' ); } // If user is older than 2.4.0 then enable the Icon Block that was added to the Core Blocks in this release. if ( version_compare( $saved_version, '2.4.0', '<' ) ) { array_push( $core_blocks, 'icon' ); } // If user is older than 2.6.0 then enable the Countdown Block that was added to the Core Blocks in this release. if ( version_compare( $saved_version, '2.6.0', '<' ) ) { array_push( $core_blocks, 'countdown' ); } // If user is older than 2.12.3 then enable the popup-builder Block that was added to the Core Blocks in this release. if ( version_compare( $saved_version, '2.12.3', '<' ) ) { array_push( $core_blocks, 'popup-builder' ); } } $inherit_from_theme = UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme' ); // If user is older than 2.13.4 and Inherit from theme is enabled update the fallback. if ( version_compare( $saved_version, '2.13.4', '<' ) && 'enabled' === $inherit_from_theme ) { UAGB_Admin_Helper::update_admin_settings_option( 'uag_btn_inherit_from_theme_fallback', 'disabled' ); } // If the core block array is not empty, update the enabled blocks option. if ( ! empty( $core_blocks ) ) { foreach ( $core_blocks as $block ) { $blocks_status[ $block ] = $block; } UAGB_Admin_Helper::update_admin_settings_option( '_uagb_blocks', $blocks_status ); } // Create file if not present. uagb_install()->create_files(); /* Create activated blocks stylesheet */ UAGB_Admin_Helper::create_specific_stylesheet(); // Update asset version number. update_option( '__uagb_asset_version', time() ); // Update auto saved version number. update_option( 'uagb-version', UAGB_VER ); do_action( 'uagb_update_after' ); } /** * Migrate_visibility_mode * * @since 2.8.0 * @return void */ public static function migrate_visibility_mode() { $old_option = UAGB_Admin_Helper::get_admin_settings_option( 'uag_enable_coming_soon_mode' ); $old_option_page = UAGB_Admin_Helper::get_admin_settings_option( 'uag_coming_soon_page' ); if ( ! $old_option && ! $old_option_page ) { return; } // Update the option. UAGB_Admin_Helper::update_admin_settings_option( 'uag_visibility_mode', $old_option ? $old_option : 'disabled' ); UAGB_Admin_Helper::update_admin_settings_option( 'uag_visibility_page', $old_option_page ? $old_option_page : '' ); // Delete the old option. UAGB_Admin_Helper::delete_admin_settings_option( 'uag_enable_coming_soon_mode' ); UAGB_Admin_Helper::delete_admin_settings_option( 'uag_coming_soon_page' ); } /** * Update asset generation option if it is not exist. * * @since 1.22.4 * @return void */ public function fresh_install_update_asset_generation_option() { uagb_install()->create_files(); if ( UAGB_Helper::is_uag_dir_has_write_permissions() ) { update_option( '_uagb_allow_file_generation', 'enabled' ); } } /** * Plugin update notification. * * @param array $data Plugin update data. * @since 2.7.2 * @return void */ public function plugin_update_notification( $data ) { if ( ! empty( $data['upgrade_notice'] ) ) { ?>
array( 'href' => array() ) ) ) ); ?>
id ) || 'plugins' !== $screen->id ) { return; } wp_enqueue_style( 'uagb-update-notice', UAGB_URL . 'admin/assets/css/update-notice.css', array(), UAGB_VER ); } } /** * Kicking this off by calling 'get_instance()' method */ UAGB_Update::get_instance(); endif;