* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com * @support http://www.wpopal.com/support/forum.html */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Opalestate_Social_Login { public function __construct() { add_action( 'opalestate_member_after_login_form', [ $this, 'login_template' ] ); add_action( 'opalelementor_after_render_login_form', [ $this, 'login_template' ] ); if ( is_admin() ) { add_filter( 'opalestate_settings_3rd_party_subtabs_nav', [ $this, 'register_admin_setting_tab' ], 1 ); add_filter( 'opalestate_settings_3rd_party_subtabs_social_login_fields', [ $this, 'register_admin_settings' ], 10, 1 ); } $this->inludes(); $this->process(); } public function inludes() { require_once 'class-opalestate-facebook-login.php'; require_once 'class-opalestate-google-login.php'; } public function process() { new Opalestate_Facebook_Login(); new Opalestate_Google_Login(); } public function login_template() { echo opalestate_load_template_path( 'user/social-login/social-login' ); } public function register_admin_setting_tab( $tabs ) { $tabs['social_login'] = esc_html__( 'Social Login', 'opalestate-pro' ); return $tabs; } public function register_admin_settings( $fields ) { $fields = apply_filters( 'opalestate_settings_review', [ [ 'name' => esc_html__( 'Google', 'opalestate-pro' ), 'desc' => '', 'type' => 'opalestate_title', 'id' => 'opalestate_title_general_settings_google', 'after_row' => '
%s
', 'opalestate-pro' ), add_query_arg( 'opal_google_login', '1', trailingslashit( get_home_url() ) ) ),
'desc' => esc_html__( 'You need to add this URL when you create API keys.', 'opalestate-pro' ),
'id' => 'google_api_redirect_url',
'type' => 'title',
],
[
'name' => esc_html__( 'Facebook', 'opalestate-pro' ),
'desc' => '',
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_facebook',
'before_row' => '%s
', 'opalestate-pro' ), add_query_arg( 'opal_facebook_login', '1', trailingslashit( get_home_url() ) ) ),
'desc' => esc_html__( 'You need to add this URL when you create API keys.', 'opalestate-pro' ),
'id' => 'facebook_api_redirect_url',
'type' => 'title',
'after_row' => '