PHP 클래스 Twitter\WordPress\Shortcodes\EmbeddedTweet

부터: 1.0.0
상속: implements Twitter\WordPress\Shortcodes\ShortcodeInterface, implements Twitter\WordPress\Shortcodes\PublishOEmbedEndpoint, use trait Twitter\WordPress\Shortcodes\OEmbedTrait
파일 보기 프로젝트 열기: twitter/wordpress 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$ALIGN_OPTIONS Accepted values for the align parameter
$SHORTCODE_DEFAULTS Accepted shortcode attributes and their default values

공개 메소드들

메소드 설명
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

메소드 상세

getOEmbedCacheKeyCustomParameters() 공개 정적인 메소드

Generate a unique string representing oEmbed result customizations set by shortcode parameters
부터: 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 }
리턴 string cache key component

init() 공개 정적인 메소드

Attach handlers for embedded Tweets
부터: 1.0.0
public static init ( ) : void
리턴 void

linkHandler() 공개 정적인 메소드

Handle a URL matched by an embed handler
부터: 1.0.0
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.
리턴 string HTML markup for the Tweet or an empty string if requirements not met

oEmbedCacheKey() 공개 정적인 메소드

Construct a cache key for the oEmbed response. Account for query parameters needing to bust cache
부터: 1.0.0
public static oEmbedCacheKey ( array $query_parameters ) : string
$query_parameters array oEmbed API query parameters
리턴 string cache key

sanitizeShortcodeParameters() 공개 정적인 메소드

Convert shortcode parameters, attributes, and defaults into a clean set of Tweet parameters
부터: 1.0.0
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 }
리턴 array cleaned up options ready for comparison { @type string option name @type string|bool option value }

sanitizeTweetID() 공개 정적인 메소드

Convert a Tweet ID in ID or URL form into a trimmed ID
부터: 1.0.0
public static sanitizeTweetID ( string $tweet_id ) : string
$tweet_id string Tweet identifier
리턴 string $tweet_id Tweet identifier or empty string if minimum requirements not met

shortcodeHandler() 공개 정적인 메소드

Handle shortcode macro
부터: 1.0.0
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
리턴 string HTML markup. empty string if parameter requirement not met or no Tweet info found

shortcodeParamsToOEmbedParams() 공개 정적인 메소드

Convert shortcode parameters into query parameters supported by the Twitter oEmbed endpoint
부터: 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
리턴 array associative array of query parameters ready for http_build_query { @type string query parameter name @type string|bool query parameter value }

shortcodeUI() 공개 정적인 메소드

Describe shortcode for Shortcake UI
부터: 1.1.0
public static shortcodeUI ( ) : void
리턴 void

프로퍼티 상세

$ALIGN_OPTIONS 공개적으로 정적으로 프로퍼티

Accepted values for the align parameter
부터: 1.0.0
public static $ALIGN_OPTIONS

$SHORTCODE_DEFAULTS 공개적으로 정적으로 프로퍼티

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