$categories['create']['items']['theme-template'] = [
'title' => esc_html__( 'Add New Theme Template', 'elementor-pro' ),
'icon' => 'plus-circle-o',
'url' => $this->get_admin_templates_url() . '#add_new',
'keywords' => [ 'template', 'theme', 'new', 'create' ],
];
return $categories;
}
/**
* Add New item to admin menu.
*
* @since 3.6.0
* @access private
*/
private function register_admin_menu( MainMenu $menu ) {
$menu->add_submenu( [
'menu_title' => esc_html__( 'Theme Builder', 'elementor-pro' ),
'menu_slug' => $this->get_admin_templates_url( true ),
'index' => 30,
] );
}
/**
* Add New item to admin menu.
*
* Fired by `admin_menu` action.
*
* @since 3.6.0
* @access private
*/
private function register_admin_menu_legacy() {
add_submenu_page(
Source_Local::ADMIN_MENU_SLUG,
'',
esc_html__( 'Theme Builder', 'elementor-pro' ),
'publish_posts',
$this->get_admin_templates_url( true )
);
}
public function print_new_theme_builder_promotion( $views ) {
/** @var Source_Local $source */
$source = Plugin::elementor()->templates_manager->get_source( 'local' );
$current_tab_group = $source->get_current_tab_group();
if ( self::ADMIN_LIBRARY_TAB_GROUP === $current_tab_group ) {
/**
* @var Admin_Notices $admin_notices
*/
$admin_notices = Plugin::elementor()->admin->get_component( 'admin-notices' );
$admin_notices->print_admin_notice( [
'title' => esc_html__( 'Meet the New Theme Builder: More Intuitive and Visual Than Ever', 'elementor-pro' ),
'description' => esc_html__( 'With the new Theme Builder you can visually manage every part of your site intuitively, making the task of designing a complete website that much easier', 'elementor-pro' ),
'button' => [
'text' => esc_html__( 'Try it Now', 'elementor-pro' ),
'class' => 'elementor-button elementor-button-success',
'url' => Plugin::elementor()->app->get_settings( 'menu_url' ),
],
] );
}
return $views;
}
private function get_admin_templates_url( $relative = false ) {
$base_url = Source_Local::ADMIN_MENU_SLUG;
if ( ! $relative ) {
$base_url = admin_url( $base_url );
}
return add_query_arg( 'tabs_group', self::ADMIN_LIBRARY_TAB_GROUP, $base_url );
}
private function add_conflicts_to_import_result( array $result ) {
$manifest_data = $result['manifest'];
if ( empty( $manifest_data['templates'] ) ) {
return $result;
}
foreach ( $manifest_data['templates'] as $template_id => $template ) {
if ( empty( $template['conditions'] ) ) {
continue;
}
foreach ( $template['conditions'] as $condition ) {
$condition = rtrim( implode( '/', $condition ), '/' );
$conflicts = $this->get_conditions_manager()->get_conditions_conflicts_by_location( $condition, $template['location'] );
if ( $conflicts ) {
$result['conflicts'][ $template_id ] = $conflicts;
}
}
}
return $result;
}
public function __construct() {
parent::__construct();
require __DIR__ . '/api.php';
$this->add_component( 'theme_support', new Classes\Theme_Support() );
$this->add_component( 'conditions', new Classes\Conditions_Manager() );
$this->add_component( 'templates_types', new Classes\Templates_Types_Manager() );
$this->add_component( 'preview', new Classes\Preview_Manager() );
$this->add_component( 'locations', new Classes\Locations_Manager() );
add_action( 'elementor/controls/register', [ $this, 'register_controls' ] );
// Editor
add_action( 'elementor/editor/init', [ $this, 'on_elementor_editor_init' ] );
add_filter( 'elementor/document/config', [ $this, 'document_config' ], 10, 2 );
// Admin
add_action( 'admin_head', [ $this, 'admin_head' ] );
add_filter( 'add_menu_classes', [ $this, 'hide_admin_app_submenu' ], 9 /* Before core submenu fixes */ );
add_action( 'manage_' . Source_Local::CPT . '_posts_custom_column', [ $this, 'admin_columns_content' ], 10, 2 );
add_action( 'elementor/template-library/create_new_dialog_fields', [ $this, 'print_location_field' ] );
add_action( 'elementor/template-library/create_new_dialog_fields', [ $this, 'print_post_type_field' ] );
if ( Plugin::elementor()->experiments->is_feature_active( 'admin_menu_rearrangement' ) ) {
add_action( 'elementor/admin/menu_registered/elementor', function( MainMenu $menu ) {
$this->register_admin_menu( $menu );
} );
} else {
add_action( 'admin_menu', function() {
$this->register_admin_menu_legacy();
}, 22 /* After core promotion menu */ );
}
add_filter( 'elementor/template-library/create_new_dialog_types', [ $this, 'create_new_dialog_types' ] );
add_filter( 'views_edit-' . Source_Local::CPT, [ $this, 'print_new_theme_builder_promotion' ], 9 );
add_filter( 'elementor/import/stage_1/result', function( array $result ) {
return $this->add_conflicts_to_import_result( $result );
} );
// Common
add_filter( 'elementor/finder/categories', [ $this, 'add_finder_items' ] );
}
}
Fatal error: Uncaught Error: Class '\ElementorPro\Modules\ThemeBuilder\Module' not found in /home/ocb/public_html/wp-content/plugins/elementor-pro/core/modules-manager.php:73
Stack trace:
#0 /home/ocb/public_html/wp-content/plugins/elementor-pro/plugin.php(327): ElementorPro\Core\Modules_Manager->__construct()
#1 /home/ocb/public_html/wp-includes/class-wp-hook.php(324): ElementorPro\Plugin->on_elementor_init('')
#2 /home/ocb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#3 /home/ocb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/ocb/public_html/wp-content/plugins/elementor/includes/plugin.php(647): do_action('elementor/init')
#5 /home/ocb/public_html/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('')
#6 /home/ocb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#7 /home/ocb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /home/ocb/public_html/wp-settings.php(704): do_action('init')
#9 /home in /home/ocb/public_html/wp-content/plugins/elementor-pro/core/modules-manager.php on line 73