Skip to content

Instantly share code, notes, and snippets.

@yhira
Last active March 9, 2020 11:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yhira/00a4eb21a847418b213834ce938e3cc4 to your computer and use it in GitHub Desktop.
WordPress本文の特定の文字列の見出しを変更する
add_filter('the_content','change_h2_to_but');
function change_h2_to_but( $content ){
return str_replace('<h2>しかし…</h2>','<h2 id="but">しかし…</h2>', $content );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment