Version Description
Download this release
Release Info
Developer | poporon |
Plugin | Pz-LinkCard |
Version | 2.2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.2.1
- lib/pz-linkcard-js.php +26 -18
- pz-linkcard.php +15 -3
- readme.txt +4 -0
lib/pz-linkcard-js.php
CHANGED
@@ -7,27 +7,35 @@
|
|
7 |
$temp_file = $this->plugin_dir_path.'templete/mce-pz-lkc-templete.js';
|
8 |
|
9 |
$js_dir = $this->upload_dir_path.'js/';
|
10 |
-
if (!is_dir($js_dir)) {
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
-
$js_file = $js_dir.'mce-pz-lkc.js';
|
14 |
-
|
15 |
-
copy($this->plugin_dir_path.'img/button.png' , $js_dir.'button.png' );
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
$
|
21 |
-
$file_text = str_replace('/*CODE*/', $this->options['code1'], $file_text );
|
22 |
|
23 |
-
$
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
}
|
33 |
unset($temp_file);
|
7 |
$temp_file = $this->plugin_dir_path.'templete/mce-pz-lkc-templete.js';
|
8 |
|
9 |
$js_dir = $this->upload_dir_path.'js/';
|
10 |
+
if (!is_dir($js_dir) && !wp_mkdir_p($js_dir)) {
|
11 |
+
$js_dir = $this->plugin_dir_path.'js/';
|
12 |
+
if (!is_dir($js_dir) && !wp_mkdir_p($js_dir)) {
|
13 |
+
$js_dir = null;
|
14 |
+
$result = false;
|
15 |
+
}
|
16 |
}
|
|
|
|
|
|
|
17 |
|
18 |
+
if ($js_dir) {
|
19 |
+
$js_file = $js_dir.'mce-pz-lkc.js';
|
20 |
+
|
21 |
+
copy($this->plugin_dir_path.'img/button.png' , $js_dir.'button.png' );
|
|
|
22 |
|
23 |
+
$file_text = file_get_contents($temp_file);
|
24 |
+
if ($file_text) {
|
25 |
+
$file_text = str_replace('/*TITLE*/', __('Insert Pz-LinkCard', $this->text_domain), $file_text );
|
26 |
+
$file_text = str_replace('/*PROMPT*/', __('Input URL', $this->text_domain), $file_text );
|
27 |
+
$file_text = str_replace('/*CODE*/', $this->options['code1'], $file_text );
|
28 |
+
|
29 |
+
$result = file_put_contents($js_file, $file_text );
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
global $pagenow;
|
34 |
+
if (isset($pagenow) && $pagenow == 'options-general.php') {
|
35 |
+
if ($result == true) {
|
36 |
+
echo '<div class="updated fade"><p><strong>'.__('Editor button JS saved.', $this->text_domain).'</strong></p></div>';
|
37 |
+
} else {
|
38 |
+
echo '<div class="error fade"><p><strong>'.__('Editor button JS failed.', $this->text_domain).'</strong></p></div>';
|
39 |
}
|
40 |
}
|
41 |
unset($temp_file);
|
pz-linkcard.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
-
Version: 2.2.2
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
@@ -168,7 +168,7 @@ class Pz_LinkCard {
|
|
168 |
'invalid-time' => null,
|
169 |
'plugin-link' => null,
|
170 |
'plugin-name' => 'Pz-LinkCard',
|
171 |
-
'plugin-version' => '2.2.2',
|
172 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
173 |
'pz-hbc-options' => null,
|
174 |
'debug-time' => null
|
@@ -1655,7 +1655,19 @@ class Pz_LinkCard {
|
|
1655 |
return $buttons;
|
1656 |
}
|
1657 |
public function add_mce_plugin($plugins) {
|
1658 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1659 |
return $plugins;
|
1660 |
}
|
1661 |
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
+
Version: 2.2.2.1
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
168 |
'invalid-time' => null,
|
169 |
'plugin-link' => null,
|
170 |
'plugin-name' => 'Pz-LinkCard',
|
171 |
+
'plugin-version' => '2.2.2.1',
|
172 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
173 |
'pz-hbc-options' => null,
|
174 |
'debug-time' => null
|
1655 |
return $buttons;
|
1656 |
}
|
1657 |
public function add_mce_plugin($plugins) {
|
1658 |
+
$js_path = $this->upload_dir_path.'js/mce-pz-lkc.js';
|
1659 |
+
$js_url = $this->upload_dir_url .'js/mce-pz-lkc.js';
|
1660 |
+
if (!file_exists($js_path)) {
|
1661 |
+
$js_path = $this->plugin_dir_path.'js/mce-pz-lkc.js';
|
1662 |
+
$js_url = $this->plugin_dir_url .'js/mce-pz-lkc.js';
|
1663 |
+
if (!file_exists($js_path)) {
|
1664 |
+
$js_path = null;
|
1665 |
+
$js_url = null;
|
1666 |
+
}
|
1667 |
+
}
|
1668 |
+
if ($js_url) {
|
1669 |
+
$plugins['pz_linkcard'] = $js_url;
|
1670 |
+
}
|
1671 |
return $plugins;
|
1672 |
}
|
1673 |
|
readme.txt
CHANGED
@@ -163,6 +163,10 @@ A7.
|
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
166 |
Ver2.2.2
|
167 |
* ビジュアルエディタの挿入ボタンの仕組みを見直しました。
|
168 |
Modified: Review the mechanism of the insert button in the visual editor.
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
166 |
+
Ver2.2.2.1
|
167 |
+
* ビジュアル エディタでエラーが表示されてしまうことがあるのを修正しました。
|
168 |
+
Fixed: Fixed a bug.
|
169 |
+
|
170 |
Ver2.2.2
|
171 |
* ビジュアルエディタの挿入ボタンの仕組みを見直しました。
|
172 |
Modified: Review the mechanism of the insert button in the visual editor.
|