PHP Class Twitter\Widgets\Buttons\PeriscopeOnAir

Since: 1.3.0
Inheritance: extends Twitter\Widgets\BaseWidget
Exibir arquivo Open project: twitter/wordpress Class Usage Examples

Public Properties

Property Type Description
$ALLOWED_SIZES Allowed values for the size property

Protected Properties

Property Type Description
$size Size of the button
$username Periscope username

Public Methods

Method Description
__construct ( $username, $validate = true ) Require username
fromArray ( array $options ) : __CLASS__ Build a Periscope On Air object from an associative array
getUsername ( ) : string Retrieve the stored Periscope username
getWebProfileURL ( ) : Periscope Build a Periscope web profile URL
setSize ( string $size ) : __CLASS__ Set the desired size of the On Air button
toArray ( ) : array Convert the class object into an array, removing default field values
toHTML ( string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string Generate a link to a Periscope web profile configured for enhancement by the Twitter for Websites JavaScript

Method Details

__construct() public method

Require username
Since: 1.3.0
public __construct ( $username, $validate = true )

fromArray() public static method

Build a Periscope On Air object from an associative array
Since: 1.3.0
public static fromArray ( array $options ) : __CLASS__
$options array associative array of options { @type string option name @type string option value }
return __CLASS__ support chaining

getUsername() public method

Retrieve the stored Periscope username
Since: 1.3.0
public getUsername ( ) : string
return string Periscope username or empty string if username not set

getWebProfileURL() public method

Build a Periscope web profile URL
Since: 1.3.0
public getWebProfileURL ( ) : Periscope
return Periscope web profile URL or empty string if username not set

setSize() public method

Set the desired size of the On Air button
Since: 1.3.0
public setSize ( string $size ) : __CLASS__
$size string button size
return __CLASS__ support chaining

toArray() public method

Convert the class object into an array, removing default field values
Since: 1.3.0
public toArray ( ) : array
return array properties as associative array

toHTML() public method

Generate a link to a Periscope web profile configured for enhancement by the Twitter for Websites JavaScript
Since: 1.3.0
public toHTML ( string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string
$html_builder_class string callable HTML builder with a static anchorElement class
return string HTML markup or empty string if minimum requirements not met

Property Details

$ALLOWED_SIZES public_oe static_oe property

Allowed values for the size property
Since: 1.3.0
public static $ALLOWED_SIZES

$size protected_oe property

Size of the button
Since: 1.3.0
protected $size

$username protected_oe property

Periscope username
Since: 1.3.0
protected $username