is_widget_template( $template_id ); } /** * Remove user edit capabilities. * * Filters the user capabilities to disable editing in admin. * * @param array $allcaps An array of all the user's capabilities. * @param array $caps Actual capabilities for meta capability. * @param array $args Optional parameters passed to has_cap(), typically object ID. * * @return array * @deprecated 3.1.0 Use `Plugin::elementor()->documents->remove_user_edit_cap()` instead. */ public function remove_user_edit_cap( $allcaps, $caps, $args ) { Plugin::elementor()->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'Plugin::elementor()->documents->remove_user_edit_cap()' ); return Plugin::elementor()->documents->remove_user_edit_cap( $allcaps, $caps, $args ); } public function is_widget_template( $template_id ) { $template_type = Source_Local::get_template_type( $template_id ); return self::TEMPLATE_TYPE === $template_type; } public function set_global_widget_included_posts_list( $post_id, $editor_data ) { $global_widget_ids = []; Plugin::elementor()->db->iterate_data( $editor_data, function( $element_data ) use ( &$global_widget_ids ) { if ( isset( $element_data['templateID'] ) ) { $global_widget_ids[] = $element_data['templateID']; } } ); foreach ( $global_widget_ids as $widget_id ) { $included_posts = get_post_meta( $widget_id, self::INCLUDED_POSTS_LIST_META_KEY, true ); if ( ! is_array( $included_posts ) ) { $included_posts = []; } $included_posts[ $post_id ] = true; update_post_meta( $widget_id, self::INCLUDED_POSTS_LIST_META_KEY, $included_posts ); } } private function delete_included_posts_css( $template_id ) { $including_post_ids = (array) get_post_meta( $template_id, self::INCLUDED_POSTS_LIST_META_KEY, true ); if ( empty( $including_post_ids ) ) { return; } foreach ( array_keys( $including_post_ids ) as $post_id ) { delete_post_meta( $post_id, '_elementor_css' ); } } /** * @param Documents_Manager $documents_manager */ public function register_documents( $documents_manager ) { $documents_manager->register_document_type( self::TEMPLATE_TYPE, Documents\Widget::get_class_full_name() ); } public function on_elementor_editor_init() { if ( ! API::is_licence_has_feature( static::LICENSE_FEATURE_NAME, API::BC_VALIDATION_CALLBACK ) ) { $promotion = Tiers::get_promotion_template( [ 'title' => esc_html__( 'Meet Our Global Widget', 'elementor-pro' ), 'messages' => [ esc_html__( 'Create Global Widgets. Modify the content, style and setting of any widget and reuse it across your website to accelerate your workflow and stay consistent.', 'elementor-pro' ), ], 'link' => 'https://go.elementor.com/go-pro-advanced-global-widget/', ], true ); Plugin::elementor()->common->add_template( $promotion, 'text' ); return; } Plugin::elementor()->common->add_template( __DIR__ . '/views/panel-template.php' ); } /** * Get document data. * * Used to manipulate data of global widgets. * * @param $data * @param $document * * @return array */ private function get_document_data( $data, $document ) { // If not a global widget template document or does not have elements. if ( ! ( $document instanceof Widget ) && ! empty( $data['elements'] ) ) { $data['elements'] = Plugin::elementor()->db->iterate_data( $data['elements'], function( $element ) { if ( ! empty( $element['templateID'] ) ) { $element['originalWidgetType'] = $element['widgetType']; $element['widgetType'] = 'global'; } return $element; } ); } return $data; } private function add_hooks() { add_action( 'elementor/documents/register', [ $this, 'register_documents' ] ); add_action( 'elementor/template-library/after_save_template', [ $this, 'set_template_widget_type_meta' ], 10, 2 ); add_action( 'elementor/template-library/after_update_template', [ $this, 'on_template_update' ], 10, 2 ); add_action( 'elementor/editor/init', [ $this, 'on_elementor_editor_init' ] ); add_action( 'elementor/editor/after_save', [ $this, 'set_global_widget_included_posts_list' ], 10, 2 ); add_filter( 'elementor_pro/editor/localize_settings', [ $this, 'add_templates_localize_data' ] ); add_filter( 'elementor/template-library/get_template', [ $this, 'filter_template_data' ] ); add_filter( 'elementor/element/get_child_type', [ $this, 'get_element_child_type' ], 10, 2 ); add_filter( 'elementor/utils/is_post_support', [ $this, 'is_post_type_support_elementor' ], 10, 3 ); add_filter( 'elementor/template_library/is_template_supports_export', [ $this, 'is_template_supports_export' ], 10, 2 ); add_filter( 'elementor/document/save/data', function ( $data, $document ) { return $this->get_document_data( $data, $document ); }, 10, 2 ); } }
Fatal error: Uncaught Error: Class "\ElementorPro\Modules\GlobalWidget\Module" not found in /htdocs/wp-content/plugins/elementor-pro/core/modules-manager.php:80 Stack trace: #0 /htdocs/wp-content/plugins/elementor-pro/plugin.php(375): ElementorPro\Core\Modules_Manager->__construct() #1 /htdocs/wp-includes/class-wp-hook.php(324): ElementorPro\Plugin->on_elementor_init('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-content/plugins/elementor/includes/plugin.php(685): do_action('elementor/init') #5 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('') #6 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /htdocs/wp-settings.php(704): do_action('init') #9 /htdocs/wp-config.php(106): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/elementor-pro/core/modules-manager.php on line 80