register_shortcodes();
}
/*
* Register all LoginRadius plugin shortcodes.
*/
public function register_shortcodes() {
add_shortcode( 'LoginRadius_Login', array( $this, 'login_shortcode' ) );
add_shortcode( 'LoginRadius_Linking', array( $this, 'linking_widget_shortcode' ) );
}
/**
* Callback for social login shortcode.
*/
public static function login_shortcode($params) {
if (is_user_logged_in()) {
return '';
}
$return = '';
$tempArray = array(
'style' => '',
);
extract(shortcode_atts($tempArray, $params));
if ($style != '') {
$return .= '
';
}
$return .= Login_Helper::get_loginradius_interface_container(true);
if ($style != '') {
$return .= '
';
}
return $return;
}
/**
* Callback for Social Linking widget shortcode
*/
public static function linking_widget_shortcode() {
global $loginradius_api_settings, $lr_custom_interface_settings;
if ( ! is_user_logged_in() ) {
return '';
}
$custom = false;
if (isset($lr_custom_interface_settings['custom_interface']) && $lr_custom_interface_settings['custom_interface'] == '1') {
$custom = true;
}
$html = LR_Common:: check_linking_status_parameters();
$apikey = $loginradius_api_settings['LoginRadius_apikey'];
$apisecret = $loginradius_api_settings['LoginRadius_secret'];
if (empty($apikey) && empty($apisecret)) {
$html .= '' . __('Your LoginRadius API key or secret is not valid, please correct it or contact LoginRadius support at
www.LoginRadius.com', 'lr-plugin-slug' ) . '
';
}
// function call
LR_Common:: link_account_if_possible();
if (empty($apikey) && empty($apisecret)) {
$html .= '' . __('Your LoginRadius API key or secret is not valid, please correct it or contact LoginRadius support at
www.LoginRadius.com', 'lr-plugin-slug' ) . '
';
}
$html .= Login_Helper::get_loginradius_interface_container(true);
$html .= '';
$html .= LR_Common::get_connected_providers_list();
$html .= '
';
return $html;
}
}
}