-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module Overrides: Add support to disable backups UI #10004
Conversation
729afe7
to
36dcdaa
Compare
36dcdaa
to
5e53261
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and just needs a couple of updates.
* | ||
* @param bool $show_backups Should UI for backups be displayed? True by default. | ||
*/ | ||
'showBackups' => is_plugin_active( 'vaultpress/vaultpress.php' ) || apply_filters( 'jetpack_show_backups', true ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Jetpack::is_plugin_active()
instead of is_plugin_active
since that one gets plugins that were single or network activated.
_inc/client/plans/plan-grid.jsx
Outdated
const hideBackupFeature = ( | ||
! this.props.showBackups && | ||
item && | ||
-1 !== backupFeatureIds.indexOf( item.id ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lodash's includes
function is already imported in this file so you can use it here:
includes( backupFeatureIds, item.id )
Thanks for the feedback! I've addressed it in the latest commit. |
Thanks. I've addressed that as well as a couple of others I found. 🙇 |
…or hiding backups UI
6f68aa8
to
9a4218c
Compare
This is automated (and not very smart btw) check which relies on Generated by 🚫 dangerJS |
Thanks for the review @eliorivero. I pushed up two commits to address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now!
@@ -7263,6 +7263,7 @@ public static function handle_post_authorization_actions( $activate_sso = false, | |||
} | |||
|
|||
/** | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL ;)
Currently, our module overrides functionality does not allow disabling UI relating to VaultPress or Backups. This is an issue for some of our partnerships where hosting partners need the ability to disable that UI.
Changes proposed in this Pull Request:
Testing instructions:
add_filter( 'jetpack_show_backups', '__return_false' );
Proposed changelog entry for your changes:
Screenshots
After
Before