| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/laragon/backup/www/quilla/wp-content/plugins/td-cloud-library/includes/ |
Upload File : |
<?php
/**
* Class tdb_state_template hold the template state (the template wp_query)
* - used to save the template state (communicate it between different hooks and the templates)
* - also used in the top black bar
*/
class tdb_state_template {
/**
* @var WP_Query
*/
private static $wp_query;
private static $tdb_template_type;
private static $tdb_template_loop_offset = 0;
/**
* save the initial template state.
* @param $new_wp_query WP_Query
*/
static function set_wp_query($new_wp_query) {
self::$wp_query = $new_wp_query;
self::$tdb_template_type = get_post_meta(self::$wp_query->post->ID, 'tdb_template_type', true);
}
/**
* @return WP_Query
*/
static function get_wp_query() {
return self::$wp_query;
}
/**
* @return bool
*/
static function has_wp_query() {
if (isset(self::$wp_query)) {
return true;
}
return false;
}
/**
* @return string - the template type
*/
static function get_template_type() {
if ( tdc_state::is_live_editor_ajax() || tdc_state::is_live_editor_iframe() ) {
return tdb_util::get_get_val('tdbTemplateType');
}
return self::$tdb_template_type;
}
/**
* @param $offset
*/
static function set_template_loop_offset($offset) {
self::$tdb_template_loop_offset = $offset;
}
/**
* @return int
*/
static function get_template_loop_offset() {
return self::$tdb_template_loop_offset;
}
static function has_shortcode($shortcode_name) {
return has_shortcode( self::$wp_query->post->post_content, $shortcode_name );
}
}