roots / acorn

Laravel components for WordPress plugins and themes
https://roots.io/acorn/
MIT License
742 stars 89 forks source link

Bug: Custom embeds for any post type don't work #325

Open KIKOmanasijev opened 2 years ago

KIKOmanasijev commented 2 years ago

Terms

Description

What's wrong?

Embeds are using the fallback HTML element (Blockquote), instead of the iframe, when being rendered on the frontend of my post/page. The embeds are being shown in the iFrame and work as intended on the editor (Gutenberg) though.

What have you tried?

What insights have you gained?

Embeds work in the editor (using Gutenberg), but not the frontend.

Possible solutions

None

Temporary workarounds

Steps To Reproduce

  1. Create a WP project ( I am using Laravel Valet )
  2. Set up a blank Sage 10 theme.
  3. Create a embed-post.blade.php in the /views subfolder with any dummy HTML.
  4. Copy the link of any post, and try to paste in another post or page. Publish this page.
  5. Embed template preview shows on the Editor, but if you visit the post/page you've created you will only see the Blockquote fallback with the title of the post you copied.

Expected Behavior

Get the iFrame of the template embed I've created on the post I've just published.

Actual Behavior

Getting the Blockquote fallback, iFrame is hidden.

Relevant Log Output

No response

Versions

Sage v10.1.16 macOs v12.1 PHP v7.4

KIKOmanasijev commented 2 years ago

Bump.

I still haven't found a solution to fix this. When I create a embed-{post-type}.blade.php, and use the embed in the editor I can see it works. The problem is that the embed is hidden by default on the site with "position: absolute; clip: rect(1px, 1px, 1px, 1px);"

trajche commented 2 months ago

Has anyone been able to figure this out?

Log1x commented 2 months ago

Does removing https://github.com/roots/sage/blob/main/app/setup.php#L40 change anything?