mirror of
https://gh.wpcy.net/https://github.com/discourse/wp-discourse.git
synced 2026-05-23 03:20:46 +08:00
42 lines
785 B
PHP
Vendored
42 lines
785 B
PHP
Vendored
<?php
|
|
/**
|
|
* Shortcode for discourse SSO
|
|
*
|
|
* @package WPDiscourse
|
|
*/
|
|
|
|
namespace WPDiscourse\SSOClient;
|
|
|
|
/**
|
|
* Class SSOClientShortcode
|
|
*/
|
|
class SSOClientShortcode extends SSOClientBase {
|
|
|
|
/**
|
|
* SSOClientShortcode constructor.
|
|
*/
|
|
public function __construct() {
|
|
add_shortcode( 'discourse_sso_client', array( $this, 'discourse_sso_client_shortcode' ) );
|
|
}
|
|
|
|
/**
|
|
* Shortcode for SSO link.
|
|
*
|
|
* @method discourse_sso_client_shortcode
|
|
*
|
|
* @param array $atts shortcode params.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function discourse_sso_client_shortcode( $atts = array() ) {
|
|
$options = shortcode_atts(
|
|
array(
|
|
'login' => null,
|
|
'link' => null,
|
|
'redirect' => null,
|
|
), $atts
|
|
);
|
|
|
|
return $this->get_discourse_sso_link_markup( $options );
|
|
}
|
|
}
|