summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
committerYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
commit0914c92da22824025992c368c745546e41fbeb84 (patch)
tree965f6adf3b725e56d559fe4a93eff02281499dcc /plugins/jetpack/3rd-party/vaultpress.php
parentDeleting plugins for update (diff)
downloadblogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.gz
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.bz2
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.zip
Adding Plugins
Updating the following akismet.4.1.2, google-authenticator.0.52, jetpack.7.3.1 Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/3rd-party/vaultpress.php')
-rw-r--r--plugins/jetpack/3rd-party/vaultpress.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/jetpack/3rd-party/vaultpress.php b/plugins/jetpack/3rd-party/vaultpress.php
new file mode 100644
index 00000000..c5cb71ff
--- /dev/null
+++ b/plugins/jetpack/3rd-party/vaultpress.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Notify user that VaultPress has been disabled. Hide VaultPress notice that requested attention.
+ *
+ * @since 5.8
+ */
+function jetpack_vaultpress_rewind_enabled_notice() {
+ // The deactivation is performed here because there may be pages that admin_init runs on,
+ // such as admin_ajax, that could deactivate the plugin without showing this notification.
+ deactivate_plugins( 'vaultpress/vaultpress.php' );
+
+ // Remove WP core notice that says that the plugin was activated.
+ if ( isset( $_GET['activate'] ) ) {
+ unset( $_GET['activate'] );
+ }
+ ?>
+ <div class="notice notice-success vp-deactivated">
+ <h2 style="margin-bottom: 0.25em;"><?php _e( 'Jetpack is now handling your backups.', 'jetpack' ); ?></h2>
+ <p><?php _e( 'VaultPress is no longer needed and has been deactivated.', 'jetpack' ); ?></p>
+ </div>
+ <style>#vp-notice{display:none;}</style>
+ <?php
+}
+
+/**
+ * If Backup & Scan is enabled, remove its entry in sidebar, deactivate VaultPress, and show a notification.
+ *
+ * @since 5.8
+ */
+function jetpack_vaultpress_rewind_check() {
+ if ( Jetpack::is_active() &&
+ Jetpack::is_plugin_active( 'vaultpress/vaultpress.php' ) &&
+ Jetpack::is_rewind_enabled()
+ ) {
+ remove_submenu_page( 'jetpack', 'vaultpress' );
+
+ add_action( 'admin_notices', 'jetpack_vaultpress_rewind_enabled_notice' );
+ }
+}
+
+add_action( 'admin_init', 'jetpack_vaultpress_rewind_check', 11 );