PHP code example of markjaquith / wp-tlc-transients
1. Go to this page and download the library: Download markjaquith/wp-tlc-transients library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
markjaquith / wp-tlc-transients example snippets
// Define your callback (other examples use this)
function my_callback() {
return wp_remote_retrieve_body(
wp_remote_get( 'http://example.com/feed.xml', array( 'timeout' => 30 ) )
);
}
// Grab that feed
echo tlc_transient( 'example-feed' )
->updates_with( 'my_callback' )
->expires_in( 300 )
->get();