Property | Type | Description | |
---|---|---|---|
$ALIGN_OPTIONS | Accepted values for the align parameter | ||
$SHORTCODE_DEFAULTS | Accepted shortcode attributes and their default values |
Method | Description | |
---|---|---|
getOEmbedCacheKeyCustomParameters ( array $query_parameters ) : string | Generate a unique string representing oEmbed result customizations set by shortcode parameters | |
init ( ) : void | Attach handlers for embedded Tweets | |
linkHandler ( array $matches, array $attr, string $url, array $rawattr ) : string | Handle a URL matched by an embed handler | |
oEmbedCacheKey ( array $query_parameters ) : string | Construct a cache key for the oEmbed response. Account for query parameters needing to bust cache | |
sanitizeShortcodeParameters ( array $attributes = [] ) : array | Convert shortcode parameters, attributes, and defaults into a clean set of Tweet parameters | |
sanitizeTweetID ( string $tweet_id ) : string | Convert a Tweet ID in ID or URL form into a trimmed ID | |
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 |
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 |
public static linkHandler ( array $matches, array $attr, string $url, array $rawattr ) : string | ||
$matches | array | The regex matches from the provided regex when calling {@link wp_embed_register_handler()}. |
$attr | array | Embed attributes. Not used. |
$url | string | The original URL that was matched by the regex. Not used. |
$rawattr | array | The original unmodified attributes. Not used. |
return | string | HTML markup for the Tweet or an empty string if requirements not met |
public static oEmbedCacheKey ( array $query_parameters ) : string | ||
$query_parameters | array | oEmbed API query parameters |
return | string | cache key |
public static sanitizeShortcodeParameters ( array $attributes = [] ) : array | ||
$attributes | array | set of shortcode attribute-value pairs or positional content matching the WordPress shortcode regex { @type string|int attribute name or positional int @type mixed shortcode value } |
return | array | cleaned up options ready for comparison { @type string option name @type string|bool option value } |
public static sanitizeTweetID ( string $tweet_id ) : string | ||
$tweet_id | string | Tweet identifier |
return | string | $tweet_id Tweet identifier or empty string if minimum requirements not met |
public static shortcodeHandler ( array $attributes, string $content = '' ) : string | ||
$attributes | array | set of shortcode attribute-value pairs or positional content matching the WordPress shortcode regex { @type string|int attribute name or positional int @type mixed shortcode value } |
$content | string | content inside a shortcode macro. no effect on this shortcode |
return | string | HTML markup. empty string if parameter requirement not met or no Tweet info found |
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 { @type string query parameter name @type string|bool query parameter value } |
public static shortcodeUI ( ) : void | ||
return | void |
public static $ALIGN_OPTIONS |