PHP Class Twitter\WordPress\Shortcodes\EmbeddedTweetVideo

Since: 1.0.0
Inheritance: extends EmbeddedTweet
Mostrar archivo Open project: twitter/wordpress Class Usage Examples

Public Properties

Property Type Description
$SHORTCODE_DEFAULTS Accepted shortcode attributes and their default values

Public Methods

Method Description
getOEmbedCacheKeyCustomParameters ( array $query_parameters ) : string Generate a unique string representing oEmbed result customizations set by shortcode parameters
init ( ) : void Attach handlers for Twitter embedded video
sanitizeShortcodeParameters ( array $attributes = [] ) : array Convert shortcode parameters into a clean set of Twitter embedded video options parameters
shortcodeHandler ( array $attributes, string $content = '' ) : string Handle shortcode macro
shortcodeParamsToOEmbedParams ( string $tweet_id, array $shortcode_options = [] ) : array Convert shortcode parameters into query parameters supported by the Twitter oEmbed endpoint
shortcodeUI ( ) : void Describe shortcode for Shortcake UI

Method Details

getOEmbedCacheKeyCustomParameters() public static method

Generate a unique string representing oEmbed result customizations set by shortcode parameters
Since: 1.0.0
public static getOEmbedCacheKeyCustomParameters ( array $query_parameters ) : string
$query_parameters array associative array of query parameters sent to the oEmbed endpoint { @type string query parameter name @type string|bool query parameter value }
return string cache key component

init() public static method

Attach handlers for Twitter embedded video
Since: 1.0.0
public static init ( ) : void
return void

sanitizeShortcodeParameters() public static method

Convert shortcode parameters into a clean set of Twitter embedded video options parameters
Since: 1.0.0
public static sanitizeShortcodeParameters ( array $attributes = [] ) : array
$attributes array set of shortcode attribute-value pairs matching the WordPress shortcode regex { @type string attribute name @type mixed shortcode value }
return array cleaned up options ready for comparison { @type string option name @type string|bool option value }

shortcodeHandler() public static method

Handle shortcode macro
Since: 1.0.0
public static shortcodeHandler ( array $attributes, string $content = '' ) : string
$attributes array shortcode attributes
$content string shortcode content. no effect
return string HTML markup

shortcodeParamsToOEmbedParams() public static method

Convert shortcode parameters into query parameters supported by the Twitter oEmbed endpoint
Since: 1.0.0
public static shortcodeParamsToOEmbedParams ( string $tweet_id, array $shortcode_options = [] ) : array
$tweet_id string Tweet identifier
$shortcode_options array customizations specified in the shortcode
return array associative array of query parameters ready for http_build_query

shortcodeUI() public static method

Describe shortcode for Shortcake UI
Since: 1.1.0
public static shortcodeUI ( ) : void
return void

Property Details

$SHORTCODE_DEFAULTS public_oe static_oe property

Accepted shortcode attributes and their default values
Since: 1.0.0
public static $SHORTCODE_DEFAULTS