PHP Class Twitter\WordPress\Shortcodes\Follow

Since: 1.0.0
Inheritance: implements Twitter\WordPress\Shortcodes\ShortcodeInterface
Afficher le fichier Open project: twitter/wordpress Class Usage Examples

Méthodes publiques

Свойство Type Description
$SHORTCODE_DEFAULTS Accepted shortcode attributes and their default values

Méthodes publiques

Méthode Description
getScreenName ( ) : string Get the Twitter screen name of the author of the current post
init ( ) : void Register shortcode macro and handler
linkHandler ( array $matches, array $attr, string $url, array $rawattr ) : string Handle a URL matched by a embed handler
sanitizeShortcodeParameters ( array $attributes = [] ) : array Clean up provided shortcode values
shortcodeHandler ( array $attributes, string $content = '' ) : string Handle shortcode macro
shortcodeUI ( ) : void Describe shortcode for Shortcake UI

Method Details

getScreenName() public static méthode

Get the Twitter screen name of the author of the current post
Since: 1.0.0
public static getScreenName ( ) : string
Résultat string Twitter screen name or empty if no screen name stored

init() public static méthode

Register shortcode macro and handler
Since: 1.0.0
public static init ( ) : void
Résultat void

linkHandler() public static méthode

Handle a URL matched by a embed handler
Since: 1.3.1
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.
Résultat string HTML markup for the follow button or an empty string if requirements not met

sanitizeShortcodeParameters() public static méthode

Be liberal in what we accept in shortcode syntax before constructing a Follow button
Since: 1.0.0
public static sanitizeShortcodeParameters ( array $attributes = [] ) : array
$attributes array provided shortcode attributes { @type string shortcode attribute name @type mixed shortcode attribute value }
Résultat array simplified shortcode values with defaults removed { @type string shortcode attribute name @type bool|string shortcode attribute value }

shortcodeHandler() public static méthode

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
Résultat string Follow button HTML or empty string

shortcodeUI() public static méthode

Describe shortcode for Shortcake UI
Since: 1.1.0
public static shortcodeUI ( ) : void
Résultat 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