HEX
Server: Apache
System: Linux webd001.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: mciraet (192513)
PHP: 8.2.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/mciraet/www/wp-content/plugins/polylang-pro/src/integrations/beaver-builder/flbuilder.php
<?php
/**
 * @package Polylang-Pro
 */

/**
 * Manages compatibility with Beaver Builder.
 *
 * @since 2.3
 */
class PLL_FLBuilder {
	/**
	 * Constructor.
	 *
	 * @since 2.3
	 */
	public function __construct() {
		add_filter( 'pll_copy_post_metas', array( $this, 'fl_builder_copy_post_metas' ), 10, 2 );
	}

	/**
	 * Allow to copy Beaver Builder data when creating a translation.
	 *
	 * @since 1.9.1
	 *
	 * @param array $metas List of custom fields names.
	 * @param bool  $sync  True if it is synchronization, false if it is a copy.
	 * @return array
	 */
	public function fl_builder_copy_post_metas( $metas, $sync ) {
		$bb_metas = array(
			'_fl_builder_draft',
			'_fl_builder_draft_settings',
			'_fl_builder_data',
			'_fl_builder_data_settings',
			'_fl_builder_enabled',
		);

		return $sync ? $metas : array_merge( $metas, $bb_metas );
	}
}