• Resolved qstear

    (@qstear)


    Hi, I’m new to WordPress and I’m working on building a plugin to enable embeds from my software product.

    Unfortunately, I don’t have an internet facing wordpress deployment that I can use to show the issue that I’m having, but I’m hoping that my issue is elementary enough that it’s possible to help with debugging.

    The wordpress deployment that I’m working with is version 5.8.1 running in Docker.

    The issue I am having is that when WordPress receives my oembed content, while it renders great in the published post, it shows up as an empty box in the post editor.

    More specifically, the components-sandbox iframe inside of wp-block-embed__wrapper has width: 0, and height: 0, in spite of the fact that my oembed endpoint returns width: 400, and height: 400.

    My entire plugin source is as follows:

    add_action("init", function(){
        wp_oembed_add_provider(
            '#https?://(www\\.)?audiograph\\.io/clip/.*#i',
            'https://audiograph.io/services/oembed/',
            true
        );
    });

    And the output of my oembed endpoint looks like this:

    {
      "version": "1.0",
      "type": "rich",
      "width": 400,
      "height": 400,
      "provider_name": "Audiograph",
      "provider_url": "https://audiograph.io",
      "html": "<iframe width=\"400\" height=\"400\" src=\"https://audiograph.io/frame_/clip/how-to-control-your-metabolism-by-thyroid--growth-hormone--episode-17-qda8/player\">"
    }

    Can anyone provide insight as to how to get the oembed preview in the wordpress editor to render something useful?

    • This topic was modified 3 years, 6 months ago by t-p. Reason: Moved to Fixing WordPress from Developing with WordPress
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Embed size is stuck at zero’ is closed to new replies.