bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Gist doesn't show when previewing post #67

Closed GaryJones closed 8 years ago

GaryJones commented 8 years ago

When previewing posts, any shortcode changes to an oembed URL, but the oembed URL doesn't get changed to a gist. When I drop in a YouTube oembed URL, the post preview shows the video.

Expected Behavior

When previewing a post, gists added via shortcode or oembed URL should show up as a gist.

Current Behavior

Shortcode changes to URL, but only the URL shows - it doesn't get converted to a gist.

Possible Solution

We possibly hook into save_post, and that may not fire when previewing a post - there may be a different hook that we could also fire on.

Steps to Reproduce (for bugs)

  1. Add a shortcode such as [gist id="bb88f9d4c3436b0d311416ada53c13a7" file="file-validate-email.php" lines="34-44"] to a new post.
  2. Hit the Preview button.

    Context

In this case, I'm trying to test #66 :-) But typically folks would want to see the embeded gist, to make sure it looks good, before publishing.

Your Environment

GaryJones commented 8 years ago

Actually, this seems to be happening on my published posts too, so it might be a wider, or a local issue.

bradyvercher commented 8 years ago

It looks like the file name in the file attribute is incorrect. If you change that value from file-validate-email.php to validate-email.php it should work fine.

GaryJones commented 8 years ago

Closing in favour of #66.