3

Last week, I asked about creating transients that would update before expiry to prevent users from waiting for the long loading time. I was pointed to WP-TLC-Transients which sound like exactly what I need, but unfortunately, I am at a loss with where to begin.

Here are the associated files:

  • class-tlc-transient-update-server.php
  • class-tlc-transient.php
  • functions.php
  • tlc-transients.php

Hopefully this is not too basic a question, but I'm interested in where to place the associated files to even begin trying to work with the code.

EDIT:

I placed class-tlc-transients-update-server.php, class-tlc-transient.php, and tlc-transients.php to my theme's directory and added include( get_stylesheet_directory() . '/tlc-transients.php' ); to my functions.php

With that settled, I plan on following the example in the readme. Are tlc-transients saved in the same place at wordpress transients? I'm wondering how I can best check if my implementation is successful.

Thank you!

4
  1. Place wherever your code can access
  2. Include tlc-transients.php during your plugin/theme load (or otherwise before init hook)
  3. Follow examples from readme for library's API use

PS in [still not very common] case you are using Composer you can also just require markjaquith/wp-tlc-transients in composer.json.

  • 1
    after "[still not very common]" I'd added "among WP developers" in PHP world, outside Wordpress, Composer is now very popular... :) – gmazzap Sep 20 '13 at 20:25
  • @G.M. yeah, that was implied :) – Rarst Sep 20 '13 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.