[wp-hackers] On slug change, do something

Haluk Karamete halukkaramete at gmail.com
Wed Jul 31 08:47:43 UTC 2013


@Nicholas
 object cache idea is very interesting.
 thank you for the code.

@Grimes
  it may be just that. one occurrence of the hook in the current code base.
in that case, my original concern has no base.
  I'm glad I asked though. thank you

On Tue, Jul 30, 2013 at 3:12 PM, Nicholas Ciske <nl at thoughtrefinery.com>wrote:

>
> Here's a Gist that'll do what you want using the 2 actions fired before
> and after a term slug is updated.
> https://gist.github.com/nciske/6117419
>
> I had to use a global variable, but it works for all taxonomies (and a
> transient seems like overkill for this). I'm open to suggestions for
> improvement.
>
> If you just wanted to do a single taxonomy, you could use this one hook
> version that exploits the fact that the slug change doesn’t immediately
> update the object cache, so we can compare the cached version to the
> database:
>
> https://gist.github.com/nciske/6117497
>
>
> _________________________
> Nick Ciske
> http://thoughtrefinery.com/
> @nciske
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list