the post from which we copy information.
* @param int $to ID of the post to which we paste information.
*
* @return array List of custom fields names.
*/
public static function save_polylang_meta( $keys, $sync, $from, $to ) {
// Copy only for a new post.
if ( ! $sync ) {
Plugin::$instance->db->copy_elementor_meta( $from, $to );
}
return $keys;
}
private static function yoast_duplicate_post() {
add_filter( 'duplicate_post_excludelist_filter', function( $meta_excludelist ) {
$exclude_list = [
Document::TYPE_META_KEY,
'_elementor_page_assets',
'_elementor_controls_usage',
'_elementor_css',
'_elementor_screenshot',
];
return array_merge( $meta_excludelist, $exclude_list );
} );
add_action( 'duplicate_post_post_copy', function( $new_post_id, $post ) {
$original_template_type = get_post_meta( $post->ID, Document::TYPE_META_KEY, true );
if ( ! empty( $original_template_type ) ) {
update_post_meta( $new_post_id, Document::TYPE_META_KEY, $original_template_type );
}
}, 10, 2 );
}
/**
* Process post meta before WP importer.
*
* Normalize Elementor post meta on import, We need the `wp_slash` in order
* to avoid the unslashing during the `add_post_meta`.
*
* Fired by `wp_import_post_meta` filter.
*
* @since 1.0.0
* @access public
* @static
*
* @param array $post_meta Post meta.
*
* @return array Updated post meta.
*/
public static function on_wp_import_post_meta( $post_meta ) {
$is_wp_importer_before_0_7 = self::is_wp_importer_before_0_7();
if ( $is_wp_importer_before_0_7 ) {
foreach ( $post_meta as &$meta ) {
if ( '_elementor_data' === $meta['key'] ) {
$meta['value'] = wp_slash( $meta['value'] );
break;
}
}
}
return $post_meta;
}
/**
* Is WP Importer Before 0.7
*
* Checks if WP Importer is installed, and whether its version is older than 0.7.
*
* @return bool
*/
public static function is_wp_importer_before_0_7() {
$wp_importer = get_plugins( '/wordpress-importer' );
if ( ! empty( $wp_importer ) ) {
$wp_importer_version = $wp_importer['wordpress-importer.php']['Version'];
if ( version_compare( $wp_importer_version, '0.7', '<' ) ) {
return true;
}
}
return false;
}
/**
* Process post meta before WXR importer.
*
* Normalize Elementor post meta on import with the new WP_importer, We need
* the `wp_slash` in order to avoid the unslashing during the `add_post_meta`.
*
* Fired by `wxr_importer.pre_process.post_meta` filter.
*
* @since 1.0.0
* @access public
* @static
*
* @param array $post_meta Post meta.
*
* @return array Updated post meta.
*/
public static function on_wxr_importer_pre_process_post_meta( $post_meta ) {
$is_wp_importer_before_0_7 = self::is_wp_importer_before_0_7();
if ( $is_wp_importer_before_0_7 ) {
if ( '_elementor_data' === $post_meta['key'] ) {
$post_meta['value'] = wp_slash( $post_meta['value'] );
}
}
return $post_meta;
}
}
Fatal error: Uncaught Error: Class 'Elementor\Compatibility' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php:873
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(629): Elementor\Plugin->__construct()
#1 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(886): Elementor\Plugin::instance()
#2 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/elementor.php(58): require('/var/www/html/d...')
#3 /var/www/html/dportilho.com.br/web/wp-settings.php(526): include_once('/var/www/html/d...')
#4 /var/www/html/dportilho.com.br/web/wp-config.php(126): require_once('/var/www/html/d...')
#5 /var/www/html/dportilho.com.br/web/wp-load.php(50): require_once('/var/www/html/d...')
#6 /var/www/html/dportilho.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/d...')
#7 /var/www/html/dportilho.com.br/web/index.php(17): require('/var/www/html/d...')
#8 {main}
thrown in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php on line 873