first commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
21
wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/integrations/duplicate-post/load.php
vendored
Normal file
21
wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/integrations/duplicate-post/load.php
vendored
Normal 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
|
||||
);
|
||||
Reference in New Issue
Block a user