dblooper
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
But I still need users to be able to register. I just need 2 different buttons, one for only registration and one for only login.
Forum: Plugins
In reply to: [Nextend Social Login and Register] Add Custom Scope PermissionsThanks Laszlo! Got it working now. Here’s the working custom plugin incase anyone searches the threads looking for the same thing.
<?php /** * Plugin Name: Custom Nextend Google Login * Description: A custom plugin to extend the Nextend Social Login Google registration process with additional Google Drive and Sheets permissions. * Version: 1.2.0 * Author: DB_Looper * License: GPL-2.0+ * License URI: https://www.gnu.org/licenses/gpl-2.0.txt */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } add_action('plugins_loaded', 'cgl_extend_nextend_google_registration', 20); function cgl_extend_nextend_google_registration() { if (class_exists('NextendSocialLoginPRO')) { add_filter('nsl_google_scopes', 'cgl_add_additional_scopes'); } else { add_action('admin_notices', 'cgl_nextend_social_login_required_notice'); } } function cgl_add_additional_scopes($scopes) { $additional_scopes = array( 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/spreadsheets', ); return array_merge($scopes, $additional_scopes); } function cgl_nextend_social_login_required_notice() { $class = 'notice notice-error'; $message = __('The "Custom Google Login" plugin requires the Nextend Social Login Pro Addon to be installed and activated.', 'custom-google-login'); printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message)); }
- This reply was modified 1 year, 7 months ago by dblooper.
Viewing 2 replies - 1 through 2 (of 2 total)