Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function change_any_texts($text){ | |
$replace = array( | |
//'変更前' => '変更後', | |
'編集' => '<a href="#">編集</a>', | |
'削除' => '<strong>削除</strong>' | |
); | |
$text = str_replace(array_keys($replace), $replace, $text); | |
return $text; | |
} | |
add_filter('the_content', 'change_any_texts'); | |
?> |
Screen shot
Note
Description | コンテンツ中のテキストを任意の文字列に置換する。どんなテキストでも置換するので注意 |
---|---|
WordPress Ver. | 3.3.1 |
Via | replace-keywords |