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

Cache does not clear when using oEmbed #34

Closed salcode closed 11 years ago

salcode commented 11 years ago

Steps to reproduce:

  1. Embed the gist using oEmbed format in a Post
  2. View the Post
  3. Update the Gist at GitHub
  4. Update the Post
  5. View the Post ( the Gist will not be updated )
salcode commented 11 years ago

It appears do_shortcode() does not process oEmbeds, so the shortcode method is not fired on

do_shortcode( $post_after->post_content );
do_shortcode( $post_before->post_content );

in method delete_gist_transients in class GistPress when the content contains oEmbed syntax rather than the shortcode syntax

salcode commented 11 years ago

How about using

apply_filters( 'the_content', $post_after->post_content );
apply_filters( 'the_content', $post_before->post_content );

instead of do_shortcode()?

I've forked the code and this is working for me.

bradyvercher commented 11 years ago

That looks like a pretty good solution to catch both cases.

It also looks like the wrong variable is being used on line 606. That should be $attrs instead of $rawattr.

If you'd like to submit a pull request against the develop branch, I'll go head and merge those changes.

GaryJones commented 11 years ago

That looks to be a great catch @salcode - this one has been bugging me for months, and it didn't even occur to me that shortcode vs oEmbed could be the difference.

bradyvercher commented 11 years ago

Fixed in #35