$dest_url, PHP_URL_QUERY ); if ( $query_string ) { parse_str( $query_string, $query_args ); if ( $query_args['redirect_to'] && preg_match( '/^admin\.php\?page=(jetpack-\w+)/i', $query_args['redirect_to'], $matches ) ) { $plugin_slug = $matches[1]; } } /** * Check for the user's unattached licenses. * * @since 3.8.2 * * @param bool $has_license Whether a license was already found. * @param array $licenses Unattached licenses belonging to the user. * @param string $plugin_slug Slug of the plugin that initiated the flow. */ if ( $plugin_slug && count( $licenses ) && apply_filters( 'jetpack_connection_user_has_license', false, $licenses, $plugin_slug ) ) { wp_safe_redirect( '/wp-admin/admin.php?page=my-jetpack#/add-license' ); exit; } } }