ault_value, $template_id ) {
return $default_value && ! $this->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_data = [
'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/',
];
$promotion_data = Filtered_Promotions_Manager::get_filtered_promotion_data( $promotion_data, 'elementor-pro/advanced-global-widget-pro-widget/promotion', 'link' );
$promotion = Tiers::get_promotion_template( $promotion_data, 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 /home/radioaztecadihit/public_html/wp-content/plugins/pro-elementor/includes/pro-elements/core/modules-manager.php:88
Stack trace:
#0 /home/radioaztecadihit/public_html/wp-content/plugins/pro-elementor/includes/pro-elements/plugin.php(367): ElementorPro\Core\Modules_Manager->__construct()
#1 /home/radioaztecadihit/public_html/wp-includes/class-wp-hook.php(341): ElementorPro\Plugin->on_elementor_init('')
#2 /home/radioaztecadihit/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
#3 /home/radioaztecadihit/public_html/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#4 /home/radioaztecadihit/public_html/wp-content/plugins/elementor/includes/plugin.php(632): do_action('elementor/init')
#5 /home/radioaztecadihit/public_html/wp-includes/class-wp-hook.php(341): Elementor\Plugin->init('')
#6 /home/radioaztecadihit/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
#7 /home/radioaztecadihit/public_html/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#8 /home/radioaztecadihit/public_html/wp-settings.php(742): do_action('init')
#9 /home/radioaztecadihit/public_html/wp-config.php(104): require_once('/home/radioazte...')
#10 /home/radioaztecadihit/public_html/wp-load.php(50): require_once('/home/radioazte...')
#11 /home/radioaztecadihit/public_html/wp-blog-header.php(13): require_once('/home/radioazte...')
#12 /home/radioaztecadihit/public_html/index.php(17): require('/home/radioazte...')
#13 {main}
thrown in /home/radioaztecadihit/public_html/wp-content/plugins/pro-elementor/includes/pro-elements/core/modules-manager.php on line 88