1 | <?php |
||
9 | class FooGallery_Polylang_Compatibility { |
||
|
|||
10 | |||
11 | function __construct() { |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Adds Foogallery post type to Polylang settings as 'public' is set to false |
||
28 | * |
||
29 | * @param $post_types |
||
30 | * @param $settings |
||
31 | * |
||
32 | * @return mixed |
||
33 | */ |
||
34 | function add_foogallery_cpt( $post_types, $settings ) { |
||
41 | |||
42 | /** |
||
43 | * Adds/whitelists polylang metabox 'ml_box' as Foogallery blocks it by default |
||
44 | * |
||
45 | * @param $metabox_ids |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | function add_pll_metaboxes ($metabox_ids) { |
||
53 | |||
54 | /** |
||
55 | * Unsets the copy and synchronization of the fooggallery post meta. |
||
56 | * A better solution will be to rewritte a copy function to get the translation |
||
57 | * |
||
58 | * @param $metas |
||
59 | * @param $sync |
||
60 | * |
||
61 | * @return mixed |
||
62 | */ |
||
63 | function ignore_foogallery_meta($metas, $sync) { |
||
82 | |||
83 | /** |
||
84 | * Add an admin notice to FooGallery pages when Polylang setting media_support is set |
||
85 | */ |
||
86 | function admin_notice() { |
||
104 | } |
||
105 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.