Skip to content

Commit cea98a2

Browse files
committed
Merge branch 'master' of github.com:Mill3/mill3-wp-utils-plugin
2 parents 3997cb1 + bfbe028 commit cea98a2

File tree

8 files changed

+100
-26
lines changed

8 files changed

+100
-26
lines changed

README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ click on "Create new translation" at the bottom/left of this window.
3131

3232
== Changelog ==
3333

34+
= 0.1.5 =
35+
36+
* Polylang Utils : Fix a bug with content duplication from a language to another one.
37+
3438
= 0.1.4 =
3539

3640
* Core component : remove Polylang ACF instruction field (added in Polylang 3.7)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php // Silence is golden
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace Mill3_Plugins\Utils\Components;
4+
use Mill3_Plugins\Utils\Components\Mill3_Wp_Utils_Component;
5+
6+
class Polylang_Utils extends Mill3_Wp_Utils_Component
7+
{
8+
protected $pll_duplicate_action_meta_name;
9+
10+
protected function init(): void
11+
{
12+
if( function_exists('pll_the_languages') ) {
13+
$this->pll_duplicate_action_meta_name = class_exists('PLL_Duplicate_Action', false) ? \PLL_Duplicate_Action::META_NAME : 'pll_duplicate_content';
14+
15+
$this->loader->add_filter('get_user_metadata', $this, 'force_pll_duplicate_action_user_meta', 10, 4);
16+
$this->loader->add_action('admin_head', $this, 'hide_pll_duplicate_button');
17+
}
18+
}
19+
20+
public function force_pll_duplicate_action_user_meta($value, $object_id, $meta_key, $single) {
21+
global $post;
22+
23+
if( $meta_key === $this->pll_duplicate_action_meta_name ) {
24+
$o = array();
25+
$o[ $post->post_type ] = 1;
26+
$value = [ $o ];
27+
}
28+
29+
return $value;
30+
}
31+
32+
public function hide_pll_duplicate_button() {
33+
echo '<style>#pll-duplicate { display: none; !important; }</style>';
34+
}
35+
36+
// getters
37+
public static function id() : string { return 'polylang-utils'; }
38+
public function version() : string { return '0.0.1'; }
39+
public function title() : string { return __('Polylang Utils', 'mill3-wp-utils'); }
40+
public function description() : string { return __('Fix various bug inside Polylang. Can\'t be disabled.', 'mill3-wp-utils'); }
41+
}

includes/class-mill3-wp-utils.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Mill3_Wp_Utils
4949
'svg',
5050
);
5151
private static $ALWAYS_ENABLED_COMPONENTS = array(
52+
//'\Mill3_Plugins\Utils\Components\Polylang_Utils',
5253
'\Mill3_Plugins\Utils\Components\Robots_Indexing',
5354
);
5455

languages/mill3-wp-utils-fr_CA.mo

415 Bytes
Binary file not shown.

languages/mill3-wp-utils-fr_CA.po

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ msgstr ""
55
"Project-Id-Version: MILL3 WP Utils 0.0.4\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mill3-wp-utils-"
77
"plugin\n"
8-
"POT-Creation-Date: 2024-08-26T19:32:08+00:00\n"
9-
"PO-Revision-Date: 2024-08-26 15:33-0400\n"
8+
"POT-Creation-Date: 2025-09-22T18:56:02+00:00\n"
9+
"PO-Revision-Date: 2025-09-22 15:01-0400\n"
1010
"Last-Translator: \n"
1111
"Language-Team: \n"
1212
"Language: fr_CA\n"
1313
"MIME-Version: 1.0\n"
1414
"Content-Type: text/plain; charset=UTF-8\n"
1515
"Content-Transfer-Encoding: 8bit\n"
16-
"X-Generator: Poedit 3.4.4\n"
16+
"X-Generator: Poedit 3.7\n"
1717
"X-Domain: mill3-wp-utils\n"
1818

1919
#. Plugin Name of the plugin
@@ -103,11 +103,11 @@ msgstr "Clé d’API OpenAI"
103103

104104
#: admin/views/ai-image-alt.php:26
105105
msgid ""
106-
"You can find your Secret API key on the <a href=\"https://platform.openai."
107-
"com/api-keys\" target=\"_blank\">API key page</a>."
106+
"You can find your Secret API key on the <a href=\"https://"
107+
"platform.openai.com/api-keys\" target=\"_blank\">API key page</a>."
108108
msgstr ""
109-
"Vous pouvez trouver votre clé d’API secrète sur la <a href=“https://platform."
110-
"openai.com/api-keys” target=“_blank”>page API key</a>."
109+
"Vous pouvez trouver votre clé d’API secrète sur la <a href=“https://"
110+
"platform.openai.com/api-keys” target=“_blank”>page API key</a>."
111111

112112
#: admin/views/ai-image-alt.php:32
113113
msgid "ChatGPT Prompt"
@@ -211,11 +211,11 @@ msgstr "Avatar"
211211
msgid "Choose an avatar from Wordpress Media Manager."
212212
msgstr "Sélectionner un avatar à partir du choix de Média de Wordpress."
213213

214-
#: components/block-visibility/block-visibility.php:56
214+
#: components/block-visibility/block-visibility.php:79
215215
msgid "Block Visibility"
216216
msgstr "Block Visibility"
217217

218-
#: components/block-visibility/block-visibility.php:57
218+
#: components/block-visibility/block-visibility.php:80
219219
msgid "This module set default values for Block Visibility plugin."
220220
msgstr ""
221221
"Ce module définit les valeurs par défaut à utiliser pour l’extension Block "
@@ -239,7 +239,6 @@ msgid "Live Site Viewer"
239239
msgstr "Visualisateur de site web"
240240

241241
#: components/live-site-viewer/live-site-viewer.php:102
242-
#: components/security-headers/security-headers.php:26
243242
msgid ""
244243
"This module allows us to showcase your awesome project in our website. If "
245244
"you ❤️ us, you should keep this active."
@@ -261,20 +260,35 @@ msgstr ""
261260
"Ce module permet aux développeurs de trouver rapidement quels publications "
262261
"utilisent un module."
263262

264-
#: components/robots-indexing/robots-indexing.php:20
263+
#: components/polylang-utils/polylang-utils.php:39
264+
msgid "Polylang Utils"
265+
msgstr "Utilitaires Polylang"
266+
267+
#: components/polylang-utils/polylang-utils.php:40
268+
msgid "Fix various bug inside Polylang. Can't be disabled."
269+
msgstr "Corrige différents problèmes de Polylang. Ne peut être désactivé."
270+
271+
#: components/robots-indexing/robots-indexing.php:27
265272
msgid "Robots Indexing"
266273
msgstr "Robots d’indexation"
267274

268-
#: components/robots-indexing/robots-indexing.php:21
269-
msgid "Prevent indexing this website if domain contains mill3.dev"
275+
#: components/robots-indexing/robots-indexing.php:28
276+
msgid ""
277+
"Prevent indexing this website if domain contains mill3.dev. Can't be "
278+
"disabled."
270279
msgstr ""
271-
"Prévient l’indexation de votre site web si le nom de domaine contient mill3."
272-
"dev"
280+
"Prévient l’indexation de votre site web si le nom de domaine contient "
281+
"mill3.dev. Ne peut être désactivé."
273282

274283
#: components/security-headers/security-headers.php:25
275284
msgid "Security Headers"
276285
msgstr "Security Headers"
277286

287+
#: components/security-headers/security-headers.php:26
288+
msgid "This module adds security header preventing clickjacking."
289+
msgstr ""
290+
"Ce module ajoute une entête de sécurité prévenant le détournement de clic."
291+
278292
#: components/svg/svg.php:52
279293
msgid "SVG"
280294
msgstr "SVG"

languages/mill3-wp-utils.pot

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Copyright (C) 2024 MILL3 Studio
1+
# Copyright (C) 2025 MILL3 Studio
22
# This file is distributed under the GPL-2.0+.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: MILL3 WP Utils 0.0.4\n"
5+
"Project-Id-Version: MILL3 WP Utils 0.1.5\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mill3-wp-utils-plugin\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <LL@li.org>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-08-26T19:32:08+00:00\n"
12+
"POT-Creation-Date: 2025-09-22T18:56:02+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.9.0\n"
1515
"X-Domain: mill3-wp-utils\n"
@@ -195,11 +195,11 @@ msgstr ""
195195
msgid "Choose an avatar from Wordpress Media Manager."
196196
msgstr ""
197197

198-
#: components/block-visibility/block-visibility.php:56
198+
#: components/block-visibility/block-visibility.php:79
199199
msgid "Block Visibility"
200200
msgstr ""
201201

202-
#: components/block-visibility/block-visibility.php:57
202+
#: components/block-visibility/block-visibility.php:80
203203
msgid "This module set default values for Block Visibility plugin."
204204
msgstr ""
205205

@@ -216,7 +216,6 @@ msgid "Live Site Viewer"
216216
msgstr ""
217217

218218
#: components/live-site-viewer/live-site-viewer.php:102
219-
#: components/security-headers/security-headers.php:26
220219
msgid "This module allows us to showcase your awesome project in our website. If you ❤️ us, you should keep this active."
221220
msgstr ""
222221

@@ -232,18 +231,30 @@ msgstr ""
232231
msgid "This module allows developers to quickly find posts using a module."
233232
msgstr ""
234233

235-
#: components/robots-indexing/robots-indexing.php:20
234+
#: components/polylang-utils/polylang-utils.php:39
235+
msgid "Polylang Utils"
236+
msgstr ""
237+
238+
#: components/polylang-utils/polylang-utils.php:40
239+
msgid "Fix various bug inside Polylang. Can't be disabled."
240+
msgstr ""
241+
242+
#: components/robots-indexing/robots-indexing.php:27
236243
msgid "Robots Indexing"
237244
msgstr ""
238245

239-
#: components/robots-indexing/robots-indexing.php:21
240-
msgid "Prevent indexing this website if domain contains mill3.dev"
246+
#: components/robots-indexing/robots-indexing.php:28
247+
msgid "Prevent indexing this website if domain contains mill3.dev. Can't be disabled."
241248
msgstr ""
242249

243250
#: components/security-headers/security-headers.php:25
244251
msgid "Security Headers"
245252
msgstr ""
246253

254+
#: components/security-headers/security-headers.php:26
255+
msgid "This module adds security header preventing clickjacking."
256+
msgstr ""
257+
247258
#: components/svg/svg.php:52
248259
msgid "SVG"
249260
msgstr ""

mill3-wp-utils.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,13 @@
8585
require plugin_dir_path( __FILE__ ) . 'components/live-site-viewer/live-site-viewer.php';
8686
require plugin_dir_path( __FILE__ ) . 'components/module-finder/module-finder.php';
8787
require plugin_dir_path( __FILE__ ) . 'components/robots-indexing/robots-indexing.php';
88+
//require plugin_dir_path( __FILE__ ) . 'components/polylang-utils/polylang-utils.php';
8889
require plugin_dir_path( __FILE__ ) . 'components/security-headers/security-headers.php';
8990
require plugin_dir_path( __FILE__ ) . 'components/svg/svg.php';
9091

91-
// start plugin
92-
$MILL_WP_UTILS = Mill3_Plugins\Utils\Mill3_Wp_Utils::get_instance();
92+
// start plugin after all plugins are loaded
93+
add_action('plugins_loaded', function() { Mill3_Plugins\Utils\Mill3_Wp_Utils::get_instance(); });
94+
9395

9496
/**
9597
* The code that runs during plugin activation.

0 commit comments

Comments
 (0)