Version Description
Download this release
Release Info
Developer | poporon |
Plugin | Pz-LinkCard |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.3 to 2.2.4
- languages/pz-linkcard-ja.mo +0 -0
- languages/pz-linkcard-ja.po +3 -3
- lib/pz-linkcard-style.php +1 -14
- pz-linkcard.php +29 -28
- readme.txt +10 -0
languages/pz-linkcard-ja.mo
CHANGED
Binary file
|
languages/pz-linkcard-ja.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: Pz-LinkCard\n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
"POT-Creation-Date: 2019-05-23 21:32+0900\n"
|
8 |
-
"PO-Revision-Date: 2019-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: poporon\n"
|
11 |
"Language: ja_JP\n"
|
@@ -369,11 +369,11 @@ msgstr "リンクカードを作成するURLを入力してください"
|
|
369 |
|
370 |
#: ../lib/pz-linkcard-js.php:36
|
371 |
msgid "Editor button JS saved."
|
372 |
-
msgstr "
|
373 |
|
374 |
#: ../lib/pz-linkcard-js.php:38
|
375 |
msgid "Editor button JS failed."
|
376 |
-
msgstr "
|
377 |
|
378 |
#: ../lib/pz-linkcard-settings.php:38
|
379 |
msgid "Short code is not set."
|
5 |
"Project-Id-Version: Pz-LinkCard\n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
"POT-Creation-Date: 2019-05-23 21:32+0900\n"
|
8 |
+
"PO-Revision-Date: 2019-07-07 22:06+0900\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: poporon\n"
|
11 |
"Language: ja_JP\n"
|
369 |
|
370 |
#: ../lib/pz-linkcard-js.php:36
|
371 |
msgid "Editor button JS saved."
|
372 |
+
msgstr "ビジュアルエディタに挿入ボタンを追加しました。"
|
373 |
|
374 |
#: ../lib/pz-linkcard-js.php:38
|
375 |
msgid "Editor button JS failed."
|
376 |
+
msgstr "ビジュアルエディタのボタンの生成に失敗しました。"
|
377 |
|
378 |
#: ../lib/pz-linkcard-settings.php:38
|
379 |
msgid "Short code is not set."
|
lib/pz-linkcard-style.php
CHANGED
@@ -1,23 +1,10 @@
|
|
1 |
<?php if (!function_exists("get_option")) die; ?>
|
2 |
<?php
|
3 |
if (!isset($this->options['style']) || !$this->options['style']) {
|
4 |
-
|
5 |
-
// $css_file = plugin_dir_path(__FILE__).'style.css';
|
6 |
-
// $css_url = plugin_dir_url(__FILE__).'style.css';
|
7 |
$css_dir = $this->upload_dir_path;
|
8 |
$css_path = $this->upload_dir_path.'style.css';
|
9 |
-
$css_url = $this->upload_dir_url .'style.css';
|
10 |
if (!is_dir($css_dir) && !wp_mkdir_p($css_dir)) {
|
11 |
-
$css_path
|
12 |
-
$css_url = $wp_upload_dir['baseurl'].'/'.$this->slug.'-style.css';
|
13 |
-
}
|
14 |
-
if (preg_match('/.*(\/\/.*)/', $css_url, $m)) {
|
15 |
-
$css_url = $m[1];
|
16 |
-
}
|
17 |
-
if (is_null($this->options['css-path']) || is_null($this->options['css-url']) || $this->options['css-path'] <> $css_path || $this->options['css-url'] <> $css_url) {
|
18 |
-
$this->options['css-path'] = $css_path;
|
19 |
-
$this->options['css-url'] = $css_url;
|
20 |
-
update_site_option('Pz_LinkCard_options', $this->options);
|
21 |
}
|
22 |
|
23 |
$temp_name = $this->plugin_dir_path.'templete/pz-linkcard-templete.css'; // 元となるテンプレート
|
1 |
<?php if (!function_exists("get_option")) die; ?>
|
2 |
<?php
|
3 |
if (!isset($this->options['style']) || !$this->options['style']) {
|
|
|
|
|
|
|
4 |
$css_dir = $this->upload_dir_path;
|
5 |
$css_path = $this->upload_dir_path.'style.css';
|
|
|
6 |
if (!is_dir($css_dir) && !wp_mkdir_p($css_dir)) {
|
7 |
+
$css_path = $this->plugin_dir_path.'style.css';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
9 |
|
10 |
$temp_name = $this->plugin_dir_path.'templete/pz-linkcard-templete.css'; // 元となるテンプレート
|
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.
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
@@ -169,7 +169,7 @@ class Pz_LinkCard {
|
|
169 |
'invalid-time' => null,
|
170 |
'plugin-link' => null,
|
171 |
'plugin-name' => 'Pz-LinkCard',
|
172 |
-
'plugin-version' => '2.2.
|
173 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
174 |
'pz-hbc-options' => null,
|
175 |
'debug-time' => null
|
@@ -210,11 +210,6 @@ class Pz_LinkCard {
|
|
210 |
$this->activate();
|
211 |
}
|
212 |
|
213 |
-
// CSS URLが空だったら生成
|
214 |
-
if (!$this->options['css-url']) {
|
215 |
-
$this->pz_SetStyle();
|
216 |
-
}
|
217 |
-
|
218 |
// ショートコードの設定
|
219 |
if ($this->options['auto-atag'] || $this->options['auto-url']) {
|
220 |
add_filter ('the_content', array($this, 'auto_replace') ); // 自動置き換え
|
@@ -247,18 +242,7 @@ class Pz_LinkCard {
|
|
247 |
add_filter ('mce_buttons', array($this, 'add_mce_button') ); // ビジュアルエディタ用ボタン
|
248 |
add_filter ('mce_external_plugins', array($this, 'add_mce_plugin') ); // ビジュアルエディタ用ボタン
|
249 |
add_filter ('plugin_action_links_'.$this->plugin_basename, array($this, 'action_links') ); // プラグイン画面
|
250 |
-
|
251 |
-
if (!$this->options['style']) {
|
252 |
-
if (!isset($this->options['css-path']) || !file_exists($this->options['css-path'])) {
|
253 |
-
$this->pz_SetStyle();
|
254 |
-
}
|
255 |
-
}
|
256 |
} else {
|
257 |
-
if (!$this->options['style']) {
|
258 |
-
if (!$this->options['css-url']) {
|
259 |
-
$this->pz_SetStyle();
|
260 |
-
}
|
261 |
-
}
|
262 |
add_action('wp_enqueue_scripts', array($this, 'enqueue'));
|
263 |
}
|
264 |
|
@@ -495,12 +479,17 @@ class Pz_LinkCard {
|
|
495 |
if ( !$link_type ) {
|
496 |
// リンクターゲットの設定
|
497 |
$target = ''; // 同ページに開く
|
498 |
-
if
|
499 |
-
if
|
500 |
$target = ' target="_blank"'; // 新しいページで開く
|
501 |
}
|
502 |
}
|
503 |
-
|
|
|
|
|
|
|
|
|
|
|
504 |
|
505 |
// キャッシュが無い、もしくは強制取得
|
506 |
if ( is_null($data_id) || ( isset($atts['force']) && $atts['force'] == true ) ) {
|
@@ -1220,6 +1209,9 @@ class Pz_LinkCard {
|
|
1220 |
$attach = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail', true );
|
1221 |
if (isset($attach) && count($attach) > 3 && isset($attach[0])) {
|
1222 |
$thumbnail = $attach[0];
|
|
|
|
|
|
|
1223 |
}
|
1224 |
} else {
|
1225 |
$title = get_bloginfo('name');
|
@@ -1682,13 +1674,22 @@ class Pz_LinkCard {
|
|
1682 |
public function enqueue($hook) {
|
1683 |
$this->amp = null;
|
1684 |
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1692 |
}
|
1693 |
|
1694 |
// 管理画面のサブメニュー追加
|
3 |
Plugin Name: Pz-LinkCard
|
4 |
Plugin URI: http://poporon.poponet.jp/pz-linkcard
|
5 |
Description: リンクをカード形式で表示します。
|
6 |
+
Version: 2.2.4
|
7 |
Author: poporon
|
8 |
Author URI: http://poporon.poponet.jp
|
9 |
License: GPLv2 or later
|
169 |
'invalid-time' => null,
|
170 |
'plugin-link' => null,
|
171 |
'plugin-name' => 'Pz-LinkCard',
|
172 |
+
'plugin-version' => '2.2.4',
|
173 |
'plugin-url' => 'https://popozure.info/pz-linkcard',
|
174 |
'pz-hbc-options' => null,
|
175 |
'debug-time' => null
|
210 |
$this->activate();
|
211 |
}
|
212 |
|
|
|
|
|
|
|
|
|
|
|
213 |
// ショートコードの設定
|
214 |
if ($this->options['auto-atag'] || $this->options['auto-url']) {
|
215 |
add_filter ('the_content', array($this, 'auto_replace') ); // 自動置き換え
|
242 |
add_filter ('mce_buttons', array($this, 'add_mce_button') ); // ビジュアルエディタ用ボタン
|
243 |
add_filter ('mce_external_plugins', array($this, 'add_mce_plugin') ); // ビジュアルエディタ用ボタン
|
244 |
add_filter ('plugin_action_links_'.$this->plugin_basename, array($this, 'action_links') ); // プラグイン画面
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
} else {
|
|
|
|
|
|
|
|
|
|
|
246 |
add_action('wp_enqueue_scripts', array($this, 'enqueue'));
|
247 |
}
|
248 |
|
479 |
if ( !$link_type ) {
|
480 |
// リンクターゲットの設定
|
481 |
$target = ''; // 同ページに開く
|
482 |
+
if (isset($this->options['ex-target'] ) ) {
|
483 |
+
if ($this->options['ex-target'] == '1' || ($this->options['ex-target'] == '2' && !$is_mobile ) ) {
|
484 |
$target = ' target="_blank"'; // 新しいページで開く
|
485 |
}
|
486 |
}
|
487 |
+
// followパラメータ
|
488 |
+
if (isset($this->options['nofollow'] ) || (isset($atts['follow'] ) && mb_strtolower($atts['follow']) == 'no') || (isset($atts['nofollow'] ) && mb_strtolower($atts['nofollow']) == 'true') ) {
|
489 |
+
$nofollow = ' rel="nofollow"'; // nofollow指定。趣味の問題?
|
490 |
+
} else {
|
491 |
+
$nofollow = '';
|
492 |
+
}
|
493 |
|
494 |
// キャッシュが無い、もしくは強制取得
|
495 |
if ( is_null($data_id) || ( isset($atts['force']) && $atts['force'] == true ) ) {
|
1209 |
$attach = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail', true );
|
1210 |
if (isset($attach) && count($attach) > 3 && isset($attach[0])) {
|
1211 |
$thumbnail = $attach[0];
|
1212 |
+
if (preg_match('/.*(\/\/.*)/', $thumbnail, $m)) { // スキームを外す
|
1213 |
+
$thumbnail = $m[1];
|
1214 |
+
}
|
1215 |
}
|
1216 |
} else {
|
1217 |
$title = get_bloginfo('name');
|
1674 |
public function enqueue($hook) {
|
1675 |
$this->amp = null;
|
1676 |
|
1677 |
+
$css_path = $this->upload_dir_path.'style.css';
|
1678 |
+
$css_url = $this->upload_dir_url .'style.css';
|
1679 |
+
if (!file_exists($css_path )) {
|
1680 |
+
$css_url = $this->plugin_dir_url .'style.css';
|
1681 |
+
}
|
1682 |
+
if (preg_match('/.*(\/\/.*)/', $css_url, $m)) { // スキームを外す
|
1683 |
+
$css_url = $m[1];
|
1684 |
+
}
|
1685 |
+
wp_enqueue_style ('pz-linkcard', $css_url);
|
1686 |
+
//if (!isset($this->options['style'])) {
|
1687 |
+
// wp_enqueue_style ('pz-linkcard', $this->options['css-url']);
|
1688 |
+
//} else {
|
1689 |
+
// if (isset($this->options['css-file'])) {
|
1690 |
+
// wp_enqueue_style('pz-linkcard', $this->options['css-file']);
|
1691 |
+
// }
|
1692 |
+
//}
|
1693 |
}
|
1694 |
|
1695 |
// 管理画面のサブメニュー追加
|
readme.txt
CHANGED
@@ -163,6 +163,16 @@ A7.
|
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
Ver2.2.3
|
167 |
* ショートコードを強制的に展開する機能を設定に追加。
|
168 |
Added: Added the function to forcibly expand the short code to the setting.
|
163 |
5. "Write shortcode and url"
|
164 |
|
165 |
== Changelog ==
|
166 |
+
Ver2.2.4
|
167 |
+
* WordPress 5.2.2 での動作確認。
|
168 |
+
Compatible with WordPress 5.2.2.
|
169 |
+
* ショートコードごとにnofollowを追加できる機能を追加。
|
170 |
+
Added: Added the function to add nofollow per short code.
|
171 |
+
* スタイルシートの取得方法を変更。
|
172 |
+
Modified: Changed style sheet acquisition method.
|
173 |
+
* 内部リンクのサムネイルのURLからスキームを省略するように変更。
|
174 |
+
Modified: Changed to omit scheme from URL of internal link thumbnail.
|
175 |
+
|
176 |
Ver2.2.3
|
177 |
* ショートコードを強制的に展開する機能を設定に追加。
|
178 |
Added: Added the function to forcibly expand the short code to the setting.
|