first commit

This commit is contained in:
2025-02-24 22:33:42 +01:00
commit 737c037e85
18358 changed files with 5392983 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
/**
* @package Polylang
*/
/**
* Manages the compatibility with Duplicate Post.
*
* @since 2.8
*/
class PLL_Duplicate_Post {
/**
* Setups actions.
*
* @since 2.8
*/
public function init() {
add_filter( 'option_duplicate_post_taxonomies_blacklist', array( $this, 'taxonomies_blacklist' ) );
}
/**
* Avoid duplicating the 'post_translations' taxonomy.
*
* @since 1.8
*
* @param array|string $taxonomies The list of taxonomies not to duplicate.
* @return array
*/
public function taxonomies_blacklist( $taxonomies ) {
if ( empty( $taxonomies ) ) {
$taxonomies = array(); // As we get an empty string when there is no taxonomy.
}
$taxonomies[] = 'post_translations';
return $taxonomies;
}
}

View File

@@ -0,0 +1,21 @@
<?php
/**
* Loads the integration with Duplicate Post.
*
* @package Polylang
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Don't access directly.
}
add_action(
'plugins_loaded',
function () {
if ( defined( 'DUPLICATE_POST_CURRENT_VERSION' ) ) {
PLL_Integrations::instance()->duplicate_post = new PLL_Duplicate_Post();
PLL_Integrations::instance()->duplicate_post->init();
}
},
0
);