PHP code example of varunsridharan / wp-transient-api
1. Go to this page and download the library: Download varunsridharan/wp-transient-api 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/ */
varunsridharan / wp-transient-api example snippets
YourPlugin_Transient_Api::instance('instance_key')->set('your-key','your-value');
YourPlugin_Transient_Api::instance('instance_key')->get('your-key'); # Returns the values only if option version matched with $option_version
YourPlugin_Transient_Api::instance('instance_key')->update('your-key','your-value'); # Updates the options value
YourPlugin_Transient_Api::instance('instance_key')->delete('your-key'); # Deletes the options and its releated options
YourPlugin_Transient_Api::instance('instance_key')->add_option('your-key','your-value');
YourPlugin_Transient_Api::instance('instance_key')->get_option('your-key'); # Returns the values only if option version matched with $option_version
YourPlugin_Transient_Api::instance('instance_key')->update_option('your-key','your-value'); # Updates the options value
YourPlugin_Transient_Api::instance('instance_key')->delete_option('your-key'); # Deletes the options and its releated options
YourPlugin_Transient_Api::instance('instance_key')->add_transient('your-key','your-value',2000);
YourPlugin_Transient_Api::instance('instance_key')->get_transient('your-key'); # Returns the values only if option version matched with $transient_version
YourPlugin_Transient_Api::instance('instance_key')->delete_transient('your-key'); # Deletes the options and its releated options
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.