• Hello Chouby,
    I just tried pll_copy_post_metas filter from your documentation but it doesn’t do what I need.

    What I just need is to Sync all Custom Meta except some that needed to be translated separately.

    Thank you in advance
    Moise

    https://wordpress.org/plugins/polylang/

    UPDATE:

    Done with that:

    add_filter('pll_copy_post_metas', 'copy_post_metas');
    
    function copy_post_metas( $metas ) {
    
    	if(($key = array_search( 'main_title', $metas ) ) !== false) {
    		unset($metas[$key]);
    	}
    
    	if(($key = array_search( 'subtitle', $metas ) ) !== false) {
    		unset($metas[$key]);
    	}
    
    	return $metas;
    
    }

    It’s not very clean but it works

  • The topic ‘Sync all post meta except some’ is closed to new replies.