WP_Embed::shortcode

SummerySummery

The do_shortcode() callback function.

Syntax

WP_Embed::shortcode( array $attr, string $url = '' )

DescriptionDescription

Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of the registered embed handlers. If none of the regex matches and it’s enabled, then the URL will be given to the WP_oEmbed class.

ParametersParameters

$attr

(array) (Required) Shortcode attributes. Optional.

  • 'width'
    (int) Width of the embed in pixels.
  • 'height'
    (int) Height of the embed in pixels.

$url

(string) (Optional) The URL attempting to be embedded.

Default value: ''

ReturnReturn

(string|false) The embed HTML on success, otherwise the original URL. ->maybe_make_link() can return false on failure.

SourceSource

File: wp-includes/class-wp-embed.php


			
Scroll to Top