<?php
/**
 * @package Linguator
 */
namespace Linguator\Integrations\duplicate_post;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Manages the compatibility with Duplicate Post.
 *
 *  
 */
class Linguator_Duplicate_Post {
	/**
	 * Setups actions.
	 *
	 *  
	 */
	public function init() {
		add_filter( 'option_duplicate_post_taxonomies_blacklist', array( $this, 'linguator_taxonomies_blacklist' ) );
	}

	/**
	 * Avoid duplicating the 'lmat_post_translations' taxonomy.
	 *
	 *  
	 *
	 * @param array|string $taxonomies The list of taxonomies not to duplicate.
	 * @return array
	 */
	public function linguator_taxonomies_blacklist( $taxonomies ) {
		if ( empty( $taxonomies ) ) {
			$taxonomies = array(); // As we get an empty string when there is no taxonomy.
		}

		$taxonomies[] = 'lmat_post_translations';
		return $taxonomies;
	}
}

