Skip to content

Commit

Permalink
スニペットの抜粋関数(get_content_excerpt)に半角スペースやタブ除去が含まれていなかった不具合修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed Aug 12, 2023
1 parent 85d41e3 commit e17bb18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions.php
Expand Up @@ -63,7 +63,7 @@ function get_content_excerpt($content, $length = 120){
$content = str_replace(' ', '', $content);//特殊文字の削除(今回はスペースのみ)
$content = preg_replace('/\[.+?\]/i', '', $content); //ショートコードを取り除く
$content = preg_replace(URL_REG, '', $content); //URLを取り除く
$content = str_replace(PHP_EOL, '', $content); //改行を取り除く
$content = preg_replace('/\s/','',$content); //半角スペースやタブ、改行を取り除く
$content = html_entity_decode($content); //HTML エンティティを対応する文字に変換する

//$lengthが整数じゃなかった場合の処理
Expand Down

0 comments on commit e17bb18

Please sign in to comment.