Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)始,故人唐宰相鲁公,🆚开府南服,余以布衣从戎。明年,别公漳水湄。后明年,公以事过张睢阳庙及颜杲卿所尝往来处,悲歌慷慨,卒不负其言而从之游。今其诗具在,可考也。😭
<?php // phpcs:disable Squiz.Commenting.FileComment.Missing -- Not used in other compat classes.
if ( ! defined( 'ABSPATH' ) ) {
// Exit if accessed directly.
exit;
}
/**
* Compatibility for the Heroic Knowledge Base plugin.
*
* @link https://herothemes.com/plugins/heroic-wordpress-knowledge-base/
*/
class ET_Builder_Plugin_Compat_HT_Knowledge_Base extends ET_Builder_Plugin_Compat_Base {
/**
* Constructor.
*/
public function __construct() {
$this->plugin_id = 'ht-knowledge-base/ht-knowledge-base.php';
$this->init_hooks();
}
/**
* Hook methods to WordPress.
*
* @return void
*/
public function init_hooks() {
// Bail if there's no version found.
if ( ! $this->get_plugin_version() ) {
return;
}
add_filter( 'template_include', array( $this, 'tb_category_page_compatibility' ) );
}
/**
* Compatibility with Heroic Knowledge Base :: Theme Builder doesn't work on category pages
* https://github.com/elegantthemes/Divi/issues/22184
*
* @param string $template The template file.
*
* @return string $template The filtered template file.
*/
public function tb_category_page_compatibility( $template ) {
global $wp_query, $ht_knowledge_base_init;
// Dummy post default.
$dummy_post_default = array();
$queried_object = isset( $wp_query->queried_object ) ? $wp_query->queried_object : null;
if ( ! empty( $queried_object->taxonomy ) && 'ht_kb_category' === $queried_object->taxonomy ) {
$dummy_post_default['is_tax'] = true;
// Reset post.
$ht_knowledge_base_init->ht_kb_theme_compat_reset_post( $dummy_post_default );
}
return $template;
}
}
new ET_Builder_Plugin_Compat_HT_Knowledge_Base();