Skip to content

Commit

Permalink
Delete meta '_elementor_css' on bulk translation
Browse files Browse the repository at this point in the history
  • Loading branch information
pacotole committed Jun 30, 2023
1 parent fff37fd commit bfc6f78
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions includes/connect-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private function __construct() {

// Don't add "_elementor_css" meta.
add_filter( 'update_post_metadata', array( $this, 'prevent_elementor_css_meta' ), 10, 3 );
add_action( 'pll_post_synchronized', array( $this, 'bulk_delete_elementor_css_meta' ), 10, 3 );

// Edit links for each language domain.
if ( cpel_is_polylang_multidomain() ) {
Expand Down Expand Up @@ -471,6 +472,24 @@ public function prevent_elementor_css_meta( $null, $post_id, $meta_key ) {

}

/**
* Delete '_elementor_css' meta on Polylang bulk translation
*
* Without this meta Elementor generates the css for the new post.
*
* @since 2.4.3
*
* @param int $post_id
* @param int $tr_id
* @param string $lang
* @return void
*/
public function bulk_delete_elementor_css_meta( $post_id, $tr_id, $lang ){

delete_post_meta( $tr_id, '_elementor_css' );

}

/**
* Whitelist Elementor Pro home_url()
*
Expand Down

0 comments on commit bfc6f78

Please sign in to comment.