n' => Filtered_Promotions_Manager::get_filtered_promotion_data(
[ 'upgrade_url' => 'https://go.elementor.com/go-pro-theme-builder/' ],
'elementor/site-editor/promotion',
'upgrade_url'
),
];
}
private function render() {
require __DIR__ . '/view.php';
}
/**
* Get Elementor editor theme color preference.
*
* Retrieve the user theme color preference as defined by editor preferences manager.
*
* @since 3.0.0
* @access private
*
* @return string Preferred editor theme.
*/
private function get_elementor_ui_theme_preference() {
$editor_preferences = SettingsManager::get_settings_managers( 'editorPreferences' );
return $editor_preferences->get_model()->get_settings( 'ui_theme' );
}
/**
* Enqueue dark theme detection script.
*
* Enqueues an inline script that detects user-agent settings for dark mode and adds a complimentary class to the body tag.
*
* @since 3.0.0
* @access private
*/
private function enqueue_dark_theme_detection_script() {
if ( 'auto' === $this->get_elementor_ui_theme_preference() ) {
wp_add_inline_script( 'elementor-app',
'if ( window.matchMedia && window.matchMedia( `(prefers-color-scheme: dark)` ).matches )
{ document.body.classList.add( `eps-theme-dark` ); }' );
}
}
private function register_packages() {
$assets_config_provider = ( new Assets_Config_Provider() )
->set_path_resolver( function ( $name ) {
return ELEMENTOR_ASSETS_PATH . "js/packages/{$name}/{$name}.asset.php";
} );
Collection::make( [ 'ui', 'icons' ] )
->each( function( $package ) use ( $assets_config_provider ) {
$suffix = Utils::is_script_debug() ? '' : '.min';
$config = $assets_config_provider->load( $package )->get( $package );
if ( ! $config ) {
return;
}
wp_register_script(
$config['handle'],
ELEMENTOR_ASSETS_URL . "js/packages/{$package}/{$package}{$suffix}.js",
$config['deps'],
ELEMENTOR_VERSION,
true
);
} );
}
private function enqueue_assets() {
Plugin::$instance->init_common();
$this->register_packages();
/** @var WebCLIModule $web_cli */
$web_cli = Plugin::$instance->modules_manager->get_modules( 'web-cli' );
$web_cli->register_scripts();
Plugin::$instance->common->register_scripts();
wp_register_style(
'select2',
$this->get_css_assets_url( 'e-select2', 'assets/lib/e-select2/css/' ),
[],
'4.0.6-rc.1'
);
Plugin::$instance->common->register_styles();
wp_register_style(
'select2',
ELEMENTOR_ASSETS_URL . 'lib/e-select2/css/e-select2.css',
[],
'4.0.6-rc.1'
);
wp_enqueue_style(
'elementor-app',
$this->get_css_assets_url( 'app', null, 'default', true ),
[
'select2',
'elementor-icons',
'elementor-common',
'select2',
],
ELEMENTOR_VERSION
);
wp_enqueue_script(
'elementor-app-packages',
$this->get_js_assets_url( 'app-packages' ),
[
'wp-i18n',
'react',
],
ELEMENTOR_VERSION,
true
);
wp_register_script(
'select2',
$this->get_js_assets_url( 'e-select2.full', 'assets/lib/e-select2/js/' ),
[
'jquery',
],
'4.0.6-rc.1',
true
);
wp_enqueue_script(
'elementor-app',
$this->get_js_assets_url( 'app' ),
[
'wp-url',
'wp-i18n',
'elementor-v2-ui',
'elementor-v2-icons',
'react',
'react-dom',
'select2',
],
ELEMENTOR_VERSION,
true
);
$this->enqueue_dark_theme_detection_script();
Assets_Translation_Loader::for_handles( [ 'elementor-app-packages', 'elementor-app' ], 'elementor' );
$this->print_config();
}
public function enqueue_app_loader() {
wp_enqueue_script(
'elementor-app-loader',
$this->get_js_assets_url( 'app-loader' ),
[
'elementor-common',
],
ELEMENTOR_VERSION,
true
);
$this->print_config( 'elementor-app-loader' );
}
private function register_import_export_customization_experiment() {
Plugin::$instance->experiments->add_feature( [
'name' => 'import-export-customization',
'title' => esc_html__( 'Import/Export Customization', 'elementor' ),
'description' => esc_html__( 'Enhanced import/export for website templates. Selectively include site content, templates, and settings with advanced granular control.', 'elementor' ),
'release_status' => ExperimentsManager::RELEASE_STATUS_BETA,
'default' => ExperimentsManager::STATE_ACTIVE,
'hidden' => true,
'mutable' => false,
] );
}
public function __construct() {
$this->register_import_export_customization_experiment();
$this->add_component( 'site-editor', new SiteEditorModule() );
if ( current_user_can( 'manage_options' ) || Utils::is_wp_cli() ) {
$this->add_component( 'import-export', new ImportExportModule() );
if ( Plugin::$instance->experiments->is_feature_active( 'import-export-customization' ) ) {
$this->add_component( 'import-export-customization', new ImportExportCustomizationModule() );
}
// Kit library is depended on import-export
$this->add_component( 'kit-library', new KitLibraryModule() );
}
$this->add_component( 'onboarding', new OnboardingModule() );
add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu ) {
$this->register_admin_menu( $admin_menu );
}, Source_Local::ADMIN_MENU_PRIORITY + 10 );
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
$this->register_editor_one_menu( $menu_data_provider );
} );
// Happens after WP plugin page validation.
add_filter( 'add_menu_classes', [ $this, 'fix_submenu' ] );
if ( $this->is_current() ) {
add_action( 'admin_init', [ $this, 'admin_init' ], 0 );
} else {
add_action( 'elementor/common/after_register_scripts', [ $this, 'enqueue_app_loader' ] );
}
}
}
Fatal error: Uncaught Error: Class 'Elementor\App\App' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php:724
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(621): Elementor\Plugin->init_components()
#1 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(341): Elementor\Plugin->init('')
#2 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
#3 /var/www/html/dportilho.com.br/web/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#4 /var/www/html/dportilho.com.br/web/wp-settings.php(742): do_action('init')
#5 /var/www/html/dportilho.com.br/web/wp-config.php(126): require_once('/var/www/html/d...')
#6 /var/www/html/dportilho.com.br/web/wp-load.php(50): require_once('/var/www/html/d...')
#7 /var/www/html/dportilho.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/d...')
#8 /var/www/html/dportilho.com.br/web/index.php(17): require('/var/www/html/d in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php on line 724