Skip to content

Conversation

@amirrnazemi
Copy link
Collaborator

This PR introduces a new shortcode type embed, enabling WordPress oEmbed rendering through Anything Shortcodes.

Included in this PR

  • Added Embed_Type class to handle [anys type="embed"]

  • Implemented automatic oEmbed resolution using wp_oembed_get() for supported providers (YouTube, Vimeo, Twitter/X, Instagram, etc.)

  • Added graceful fallback behavior:

    • Uses the fallback attribute if provided
    • Falls back to a safe <a> link when oEmbed fails
  • Normalized shortcode attributes through the shared attribute resolver for consistency

  • Ensured output is returned safely without stripping allowed oEmbed HTML (no wp_kses_post applied to iframe output)

Let me know if you’d like additional provider-specific handling, URL normalization rules, or stricter sanitization for embed output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants