Skip to content

Commit

Permalink
present welcome screen only when Groups is activated alone
Browse files Browse the repository at this point in the history
  • Loading branch information
itthinx committed Nov 28, 2024
1 parent 8e7eaeb commit 721b0c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* WordPress 6.7 compatible.
* Adds fixes for "Translation loading for the ... domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. ..." PHP notices raised as of WordPress 6.7.0 in certain scenarios when translations are requested before the init or the after_setup_theme action have fired.
* Avoids a potential infinite recursion when evaluating post counts.
* Make sure to present welcome screen only when Groups is activated alone and not in bulk.

= 3.3.0 =
* WordPress 6.7 compatible.
Expand Down
9 changes: 8 additions & 1 deletion lib/admin/class-groups-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,19 @@ public static function admin_init() {
!$doing_cron &&
( empty( $_GET['page'] ) || $_GET['page'] !== 'groups-welcome' ) &&
!is_network_admin() &&
!isset( $_GET['activate-multi'] ) &&
isset( $_REQUEST['activate'] ) && // @since 3.3.1 must be single activation
!isset( $_REQUEST['activate-multi'] ) &&
!isset( $_REQUEST['activate-selected'] ) && // @since 3.3.1 must not be multiple activation
!isset( $_REQUEST['update-selected'] ) && // @since 3.3.1 must not be multiple update
Groups_User::current_user_can( GROUPS_ACCESS_GROUPS ) &&
apply_filters( 'groups_welcome_show', true )
) {
wp_safe_redirect( admin_url( 'index.php?page=groups-welcome' ) );
exit;
} else {
// @since 3.3.1 remove transients as we don't want to trigger a redirect in any other case than direct activation of the Groups plugin, also see above
delete_transient( 'groups_plugin_activated' );
delete_transient( 'groups_plugin_updated_legacy' );
}
}
}
Expand Down

0 comments on commit 721b0c0

Please sign in to comment.