plates[ $template_id ] ) ) {
unset( $favorites_templates[ $template_id ] );
}
return $this->update_user_meta( 'favorites', $favorites_templates );
}
/**
* Get current user meta.
*
* Retrieve Elementor meta data for the current user.
*
* @since 1.9.0
* @access public
*
* @param string $item Optional. User meta key. Default is null.
*
* @return null|array An array of user meta data, or null otherwise.
*/
public function get_user_meta( $item = null ) {
if ( null === $this->user_meta ) {
$this->user_meta = get_user_meta( get_current_user_id(), $this->get_user_meta_prefix(), true );
}
if ( ! $this->user_meta ) {
$this->user_meta = [];
}
if ( $item ) {
if ( isset( $this->user_meta[ $item ] ) ) {
return $this->user_meta[ $item ];
}
return null;
}
return $this->user_meta;
}
/**
* Update current user meta.
*
* Update user meta data based on meta key an value.
*
* @since 1.9.0
* @access public
*
* @param string $key Optional. User meta key.
* @param mixed $value Optional. User meta value.
*
* @return int|bool User meta ID if the key didn't exist, true on successful
* update, false on failure.
*/
public function update_user_meta( $key, $value ) {
$meta = $this->get_user_meta();
$meta[ $key ] = $value;
$this->user_meta = $meta;
return update_user_meta( get_current_user_id(), $this->get_user_meta_prefix(), $meta );
}
/**
* Replace elements IDs.
*
* For any given Elementor content/data, replace the IDs with new randomly
* generated IDs.
*
* @since 1.0.0
* @access protected
*
* @param array $content Any type of Elementor data.
*
* @return mixed Iterated data.
*/
protected function replace_elements_ids( $content ) {
return Plugin::$instance->db->iterate_data( $content, function( $element ) {
$element['id'] = Utils::generate_random_string();
return $element;
} );
}
/**
* Get Elementor library user meta prefix.
*
* Retrieve user meta prefix used to save Elementor data.
*
* @since 1.9.0
* @access protected
*
* @return string User meta prefix.
*/
protected function get_user_meta_prefix() {
return 'elementor_library_' . $this->get_id();
}
/**
* Process content for export/import.
*
* Process the content and all the inner elements, and prepare all the
* elements data for export/import.
*
* @since 1.5.0
* @access protected
*
* @param array $content A set of elements.
* @param string $method Accepts either `on_export` to export data or
* `on_import` to import data.
*
* @return mixed Processed content data.
*/
protected function process_export_import_content( $content, $method ) {
return Plugin::$instance->db->iterate_data(
$content, function( $element_data ) use ( $method ) {
$element = Plugin::$instance->elements_manager->create_element_instance( $element_data );
// If the widget/element isn't exist, like a plugin that creates a widget but deactivated
if ( ! $element ) {
return null;
}
return $this->process_element_export_import_content( $element, $method );
}
);
}
/**
* Process single element content for export/import.
*
* Process any given element and prepare the element data for export/import.
*
* @since 1.5.0
* @access protected
*
* @param Controls_Stack $element
* @param string $method
*
* @return array Processed element data.
*/
protected function process_element_export_import_content( Controls_Stack $element, $method ) {
$element_data = $element->get_data();
if ( method_exists( $element, $method ) ) {
// TODO: Use the internal element data without parameters.
$element_data = $element->{$method}( $element_data );
}
foreach ( $element->get_controls() as $control ) {
$control_class = Plugin::$instance->controls_manager->get_control( $control['type'] );
// If the control isn't exist, like a plugin that creates the control but deactivated.
if ( ! $control_class ) {
return $element_data;
}
if ( method_exists( $control_class, $method ) ) {
$element_data['settings'][ $control['name'] ] = $control_class->{$method}( $element->get_settings( $control['name'] ), $control );
}
// On Export, check if the control has an argument 'export' => false.
if ( 'on_export' === $method && isset( $control['export'] ) && false === $control['export'] ) {
unset( $element_data['settings'][ $control['name'] ] );
}
}
return $element_data;
}
}
Fatal error: Uncaught Error: Class "Elementor\TemplateLibrary\Source_Base" not found in /htdocs/wp-content/plugins/elementor/includes/template-library/sources/local.php:31
Stack trace:
#0 /htdocs/wp-content/plugins/elementor/includes/autoloader.php(294): require()
#1 /htdocs/wp-content/plugins/elementor/includes/autoloader.php(330): Elementor\Autoloader::load_class('TemplateLibrary...')
#2 /htdocs/wp-content/plugins/elementor/modules/library/documents/library-document.php(47): Elementor\Autoloader::autoload('Elementor\\Templ...')
#3 /htdocs/wp-content/plugins/elementor/modules/library/documents/not-supported.php(31): Elementor\Modules\Library\Documents\Library_Document::get_properties()
#4 /htdocs/wp-content/plugins/elementor/core/base/document.php(281): Elementor\Modules\Library\Documents\Not_Supported::get_properties()
#5 /htdocs/wp-content/plugins/elementor/core/documents-manager.php(148): Elementor\Core\Base\Document::get_property('cpt')
#6 /htdocs/wp-content/plugins/elementor/modules/library/module.php(46): Elementor\Core\Documents_Manager->register_document_type('not-supported', 'Elementor\\Modul...')
#7 /htdocs/wp-content/plugins/elementor/core/base/module.php(85): Elementor\Modules\Library\Module->__construct()
#8 /htdocs/wp-content/plugins/elementor/core/modules-manager.php(64): Elementor\Core\Base\Module::instance()
#9 /htdocs/wp-content/plugins/elementor/includes/plugin.php(730): Elementor\Core\Modules_Manager->__construct()
#10 /htdocs/wp-content/plugins/elementor/includes/plugin.php(647): Elementor\Plugin->init_components()
#11 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('')
#12 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#13 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /htdocs/wp-settings.php(727): do_action('init')
#15 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...')
#16 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...')
#17 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...')
#18 /htdocs/index.php(17): require('/htdocs/wp-blog...')
#19 {main}
thrown in /htdocs/wp-content/plugins/elementor/includes/template-library/sources/local.php on line 31