core
css
epanel
et-pagebuilder
images
includes
builder
api
compat
feature
frontend-builder
images
languages
module
plugin-compat
post
scripts
styles
templates
tests
theme-compat
_et_builder_version.php
ab-testing.php
autoload.php
class-et-builder-dynamic-assets-feature.php
class-et-builder-element.php
class-et-builder-global-feature-base.php
class-et-builder-google-fonts-feature.php
class-et-builder-module-features.php
class-et-builder-module-shortcode-manager.php
class-et-builder-module-use-detection.php
class-et-builder-plugin-compat-base.php
class-et-builder-plugin-compat-loader.php
class-et-builder-post-feature-base.php
class-et-builder-settings.php
class-et-builder-theme-compat-base.php
class-et-builder-theme-compat-handler.php
class-et-builder-value.php
class-et-global-settings.php
comments_template.php
conditions.php
core.php
deprecations.php
framework.php
functions.php
main-structure-elements.php
template-preview.php
functions
module-customizer
widgets
block-editor-integration.php
navigation.php
no-results.php
social_icons.php
theme-builder.php
widgets.php
js
lang
psd
404.php
CREDITS.md
LICENSE.md
README.md
changelog.txt
comments.php
composer.json
footer.php
functions.php
header.php
index.php
options_divi.php
page-template-blank.php
page.php
post_thumbnails_divi.php
screenshot.jpg
sidebar-footer.php
sidebar.php
single-et_pb_layout.php
single-project.php
single.php
style-cpt-rtl.min.css
style-cpt.min.css
style-rtl.min.css
style-static-cpt-rtl.min.css
style-static-cpt.min.css
style-static-rtl.min.css
style-static.min.css
style.css
style.min.css
theme-after-footer.php
theme-after-header.php
theme-after-wrappers.php
theme-before-wrappers.php
theme-footer.php
theme-header.php
wpml-config.xml
69 lines
1.3 KiB
PHP
69 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Load theme compatibility file for current theme.
|
|
*
|
|
* @since 4.10.0
|
|
* @package Divi
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit; // Exit if accessed directly.
|
|
}
|
|
|
|
/**
|
|
* Class ET_Builder_Plugin_Compat_Loader.
|
|
*/
|
|
class ET_Builder_Theme_Compat_Handler {
|
|
/**
|
|
* Unique instance of class.
|
|
*
|
|
* @var ET_Builder_Theme_Compat_Handler
|
|
*/
|
|
public static $instance;
|
|
|
|
/**
|
|
* Constructor.
|
|
*/
|
|
private function __construct() {
|
|
$this->_init_hooks();
|
|
}
|
|
|
|
/**
|
|
* Gets the instance of the class.
|
|
*/
|
|
public static function init() {
|
|
if ( null === self::$instance ) {
|
|
self::$instance = new self();
|
|
}
|
|
|
|
return self::$instance;
|
|
}
|
|
|
|
/**
|
|
* Hook methods to WordPress action and filter.
|
|
*
|
|
* @return void
|
|
*/
|
|
private function _init_hooks() {
|
|
// Load plugin.php for frontend usage.
|
|
if ( ! function_exists( 'wp_get_theme' ) ) {
|
|
include_once ABSPATH . 'wp-admin/includes/theme.php';
|
|
}
|
|
|
|
$current_theme = wp_get_theme();
|
|
$current_theme_name = $current_theme->get( 'TextDomain' );
|
|
$theme_compat_url = apply_filters(
|
|
"et_builder_theme_compat_path_{$current_theme_name}",
|
|
ET_BUILDER_DIR . "theme-compat/{$current_theme_name}.php",
|
|
$current_theme_name
|
|
);
|
|
|
|
if ( file_exists( $theme_compat_url ) ) {
|
|
require_once $theme_compat_url;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
ET_Builder_Theme_Compat_Handler::init();
|