Dear.
I asked “What should I do?”, But I’ll write the answer.
This is about line 270. The lines from “[DEBUG] [BEGIN]” to “[DEBUG] [END]” are added.
add_filter ('mce_buttons', array($this, 'add_mce_button' ) ); // ビジュアルエディタ用ボタン
add_filter ('mce_external_plugins', array($this, 'add_mce_plugin' ) ); // ビジュアルエディタ用ボタン
add_filter ('plugin_action_links_'.$this->plugin_basename, array($this, 'action_links' ) ); // プラグイン画面
} else {
//[DEBUG] [BEGIN] 2021/04/20 Convert the URL of the comment box
add_filter ('comment_text', array($this, 'filter_comment' ) );
//[DEBUG] [END] 2021/04/20 Convert the URL of the comment box
add_action ('wp_enqueue_scripts', array($this, 'enqueue' ) ); // スタイルシート呼び出し
if ($this->options['auto-atag'] || $this->options['auto-url'] ) { // 自動置き換え
add_filter ('the_content', array($this, 'auto_replace' ) );
add_shortcode ('pz-linkcard-auto-replace', array($this, 'shortcode' ) );
}
And next is about the 310th line.
In the same way, add lines from “[DEBUG] [BEGIN]” to “[DEBUG] [END]”.
if (!wp_next_scheduled('pz_linkcard_alive' ) ) {
wp_schedule_event(time() + 1800 , 'daily', 'pz_linkcard_alive' );
}
}
}
//[DEBUG] [BEGIN] 2021/04/20 Convert the URL of the comment box
public function filter_comment($content ) {
if ($this->options['auto-atag'] || $this->options['auto-url'] ) {
$content = $this->auto_replace($content );
}
//$content = do_shortcode($content );
return $content;
}
//[DEBUG] [END] 2021/04/20 Convert the URL of the comment box
// テキストリンクの行とURLのみの行をリンクカードへ置き換える処理(直接HTMLタグにするのでは無くショートコードに変換する。)
public function auto_replace($content ) {
if (!$this->options['auto-external'] ) {
// 内部リンクも外部リンクも変換する
if ($this->options['auto-atag'] ) {
$content = preg_replace('/(^|<br ?\/?>)(<p.*>)?<a\s.*href\s*=\s*[\'"]?((https?|file|ftp|data|ogg):\/\/[^ \'"<]+)[\'"]?[^<]*<\/a>(<\/p>)?$/im', '[pz-linkcard-auto-replace url="$3"]', $content );
}
If you delete “//” from the part where “// $ content = do_shortcode ($ content);” and change it to “$ content = do_shortcode ($ content);”, you can use the shortcode.
I may be able to help you, so please call me again.
Let’s enjoy together.
* This sentence uses translation. I’m sorry if there is a rude wording.
-
This reply was modified 3 years, 7 months ago by ぽぽろん@ぽぽづれ。.
-
This reply was modified 3 years, 7 months ago by ぽぽろん@ぽぽづれ。.