Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Plugin Name: the time
- */
- function show_esi(){
- if( method_exists( 'LiteSpeed_Cache_API', 'esi_enabled' ) && LiteSpeed_Cache_API::esi_enabled() ) {
- // To make sure is using the compatible API version
- if ( method_exists( 'LiteSpeed_Cache_API', 'v' ) && LiteSpeed_Cache_API::v( '1.3' ) ) {
- // Let's turn this block to ESI by returning directly
- return LiteSpeed_Cache_API::esi_url( 'thetime_esi', 'My Plugin the time' ) ;
- }
- }
- }
- if ( method_exists( 'LiteSpeed_Cache_API', 'esi_enabled' ) && LiteSpeed_Cache_API::esi_enabled() ) {
- LiteSpeed_Cache_API::hook_tpl_esi('hook_esi' );
- }
- function hook_esi(){
- echo time();
- exit;
- }
- function theTime(){
- echo show_esi() ;
- // echo time();
- }
- add_shortcode('thetime', 'theTime');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement