Integrating WP-TLC-Transients with WordPress – Where to Begin?

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:

Read More
  • 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!

Related posts

1 comment

    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.

Comments are closed.