PluginProbe
Polylang / 3.0.6
Polylang v3.0.6
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / integrations / duplicate-post / duplicate-post.php

duplicate-post.php in Polylang 3.0.6, at integrations/duplicate-post/duplicate-post.php

39 lines 719 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 /**
7 * Manages the compatibility with Duplicate Post.
8 *
9 * @since 2.8
10 */
11 class PLL_Duplicate_Post {
12 /**
13 * Setups actions.
14 *
15 * @since 2.8
16 */
17 public function init() {
18 add_filter( 'option_duplicate_post_taxonomies_blacklist', array( $this, 'taxonomies_blacklist' ) );
19 }
20
21 /**
22 * Duplicate Post
23 * Avoid duplicating the 'post_translations' taxonomy
24 *
25 * @since 1.8
26 *
27 * @param array|string $taxonomies
28 * @return array
29 */
30 public function taxonomies_blacklist( $taxonomies ) {
31 if ( empty( $taxonomies ) ) {
32 $taxonomies = array(); // As we get an empty string when there is no taxonomy
33 }
34
35 $taxonomies[] = 'post_translations';
36 return $taxonomies;
37 }
38 }
39